Announcement

Collapse
No announcement yet.

Nextion

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Nextion

    Hi,

    I am trying to integrate Nextion LCDs into Homeseer via Arduino and your Plug_In. Arduino, with a very simple Sketch that I am attaching to you, works correctly with Nextion, your plug_in with Arduino works very well but I cannot integrate the lines of code in your Sketch to interact with Nextion. While compiling I always have some errors. I'm probably wrong where I put the code. Do you have some advice?

    Thank you

    #2
    I can not see the code in your post?
    Zwave = Z-Stick, 3xHSM100� 7xACT ZDM230, 1xEverspring SM103, 2xACT HomePro ZRP210.
    X10 = CM12U, 2xAM12, 1xAW10, 1 x TM13U, 1xMS13, 2xHR10, 2xSS13
    Other Hardware = ADI Ocelot + secu16, Global Cache GC100, RFXtrx433, 3 x Foscams.
    Plugings = RFXcom, ActiveBackup, Applied Digital Ocelot, BLDeviceMatrix, BLGarbage, BLLAN, Current Cost, Global Cache GC100,HSTouch Android, HSTouch Server, HSTouch Server Unlimited, NetCAM, PowerTrigger, SageWebcamXP, SqueezeBox, X10 CM11A/CM12U.
    Scripts =
    Various

    Comment


      #3
      Originally posted by enigmatheatre View Post
      I can not see the code in your post?
      #include <Nextion.h>

      NexButton bOn = NexButton(0, 1, "b0");

      NexTouch *nex_listen_list[] = {
      &bOn, NULL
      };
      void setup() {
      // put your setup code here, to run once:
      Serial.begin(9600);
      pinMode(3, OUTPUT);
      nexInit();
      bOn.attachPop(bton, &bOn);

      }

      void loop() {
      // put your main code here, to run repeatedly:
      nexLoop(nex_listen_list);

      }

      void bton(void *ptr) {
      digitalWrite(3, HIGH);
      }

      Comment


        #4
        I guess you are using the API. I would think something like this:
        Code:
        //**************Declare your variables here*******************
        #include <Nextion.h>
        
        NexButton bOn = NexButton(0, 1, "b0");
        
        NexTouch *nex_listen_list[] = {
        &bOn, NULL
        };
        
        //************************************************************ ****
        
        
        
        
        void HSSetup() {
        
        //************************
        //Add YOUR SETUP HERE;
        //************************
        
        pinMode(3, OUTPUT);
        nexInit();
        bOn.attachPop(bton, &bOn);
        
        
        }
        
        
        void HSloop() {
        //************************
        //Add YOUR CODE HERE;
        //************************
        /* To Send Data to Homeseer use SendToHS(Device,Value)
        Eg.. SendToHS(1,200); where 1 is the API device in homeseer and 200 is the value to send
        To Recieve data from Homeseer look up the FromHS array that is updated when the device value changes.
        Eg.. FromHS[5] would be the data from API Output device 5
        All code that is located just below this block will execute regardless of connection status!
        You can include SendToHS() calls, however when there isn't an active connection, it will just return and continue.
        If you only want code to execute when HomeSeer is connected, put it inside the if statement below.
        */
        
        /*Execute regardless of connection status*/
        
        nexLoop(nex_listen_list);
        
        if (IsConnected == true) {
        /*Execute ONLY when HomeSeer is connected*/
        
        
        }
        
        }
        
        //Voids After here.
        
        
        void bton(void *ptr) {
        digitalWrite(3, HIGH);
        }
        What errors are you getting?
        Zwave = Z-Stick, 3xHSM100� 7xACT ZDM230, 1xEverspring SM103, 2xACT HomePro ZRP210.
        X10 = CM12U, 2xAM12, 1xAW10, 1 x TM13U, 1xMS13, 2xHR10, 2xSS13
        Other Hardware = ADI Ocelot + secu16, Global Cache GC100, RFXtrx433, 3 x Foscams.
        Plugings = RFXcom, ActiveBackup, Applied Digital Ocelot, BLDeviceMatrix, BLGarbage, BLLAN, Current Cost, Global Cache GC100,HSTouch Android, HSTouch Server, HSTouch Server Unlimited, NetCAM, PowerTrigger, SageWebcamXP, SqueezeBox, X10 CM11A/CM12U.
        Scripts =
        Various

        Comment


          #5
          Hi thanks for the information.
          Now the compilation works correctly. I had some access restrictions on the PC.
          With the nextion code inserted in the sketch when I press the button on the LCD display I pass the information to Arduino that with "HIGH" activates output 3 which with an event in HS4, thanks to your Plug-In, when output 3 è High executes a command.
          Unfortunately this does not happen. I am sure that the command passes to Arduino because with the "Stand Alone" Sketch I can turn on, with a suitable resistance, a led connected to output 3 and Gnd.
          I have activated output 3 in the plug-in and inserted it in the events as a change of state to ON. It's correct ?

          Thank you

          Comment


            #6
            Hi,

            in the Log I have this error: can it be useful?

            Thank you
            Attached Files

            Comment


              #7
              What Version of the plugin are you running. I believe the errors you are seeing are fixed in the Beta.

              Can you Attach the Full API sketch you are using? When using the API sketch you have to set up your own I/O in the sketch and can not set it in the plugin so you need to add the pins you want to control and add the ToHS and FromHS commands to trigger HS.
              Zwave = Z-Stick, 3xHSM100� 7xACT ZDM230, 1xEverspring SM103, 2xACT HomePro ZRP210.
              X10 = CM12U, 2xAM12, 1xAW10, 1 x TM13U, 1xMS13, 2xHR10, 2xSS13
              Other Hardware = ADI Ocelot + secu16, Global Cache GC100, RFXtrx433, 3 x Foscams.
              Plugings = RFXcom, ActiveBackup, Applied Digital Ocelot, BLDeviceMatrix, BLGarbage, BLLAN, Current Cost, Global Cache GC100,HSTouch Android, HSTouch Server, HSTouch Server Unlimited, NetCAM, PowerTrigger, SageWebcamXP, SqueezeBox, X10 CM11A/CM12U.
              Scripts =
              Various

              Comment

              Working...
              X