Announcement

Collapse
No announcement yet.

Arduino Script Testing. (Enigmatheatre)

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

  • Sorry gdyrdave I think there was a problem when I compiled the code as I am a little rusty with HS2 now.
    Try the attached version.

    Greig.
    Attached Files
    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


    • We'll give it a try. Thanks Greig.

      Comment


      • Just tried it, it stays at 115200.

        4/26/2014 8:18:00 AM Arduino Connecting to Arduino Board 1 on Com Port=14 baud= 115200 Parity= 0 DataBits= 8 stopBits= 1
        4/26/2014 8:17:46 AM Arduino Connecting to Arduino Board 1 on Com Port=14 baud= 115200 Parity= 0 DataBits= 8 stopBits= 1

        The ini file:


        [Settings]
        Logging =0
        No of Boards=1



        [Board1]
        Com port=14
        Baud=57600

        Board Address=1
        Board Code=D1
        No Of Inputs=0
        No Of Analogue=0
        No Of Outputs=0
        No Of PwmOutputs=0


        Lcd Width=16
        Lcd Hight=2
        Lcd Clear=1

        RomAddress,28D9158D05000093=D9
        RomAddress,28E2218D0500101D=D2

        Comment


        • I had a quick look and I have set this as a global setting for all boards so if you add "Baud" to Settings in the ini it should work.

          Greig.
          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


          • As my post above I have set the Baud=57600. It still initialized to 115200. Shouldn't the log file reflect that? I also verified it is indeed set to 115200 using the posted ini file. Maybe I am not seeing something.

            Comment


            • I figured it out. I moved the Baud=57600 under the settings rather than under the board settings. It initializes to 57600 as expected. Thanks. Will test it with the Xbees.

              Comment


              • Thank you Soooooooooo much Greig. Works like a champ. You are my Hero !!!!

                Thanks again.

                Dave

                Comment


                • Great news. Have fun.

                  Sent from my HTC One using Tapatalk
                  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


                  • Hi. Thank you for your efforts. I installed your plugin with absolutely no problems on my HS2 setup and I can see those pins come on and off on my Status page.

                    What I wanted to ask you is if it is possible to use a Moteino to wirelessly send data or pin status to another Moteino connected to HS via the plugin.

                    If you're not familiar with Moteino, you can find info here: http://lowpowerlab.com/moteino

                    These are very cheap and looks like they would be a game changer for this kind of application. Imagine connecting anything you want on one side and have it all mirroed on the other and fed into HS.

                    So this is an example of a sketch that is loaded on a Receiver Moteino:

                    Code:
                    // Sample RFM69 receiver/gateway sketch, with ACK and optional encryption
                    // Passes through any wireless received messages to the serial port & responds to ACKs
                    // It also looks for an onboard FLASH chip, if present
                    // Library and code by Felix Rusu - felix@lowpowerlab.com
                    // Get the RFM69 and SPIFlash library at: https://github.com/LowPowerLab/
                    
                    
                    #include <rfm69.h>
                    #include <spi.h>
                    #include <spiflash.h>
                    
                    
                    #define NODEID        1    //unique for each node on same network
                    #define NETWORKID     100  //the same on all nodes that talk to each other
                    //Match frequency to the hardware version of the radio on your Moteino (uncomment one):
                    #define FREQUENCY     RF69_433MHZ
                    //#define FREQUENCY     RF69_868MHZ
                    //#define FREQUENCY     RF69_915MHZ
                    #define ENCRYPTKEY    "sampleEncryptKey" //exactly the same 16 characters/bytes on all nodes!
                    //#define IS_RFM69HW    //uncomment only for RFM69HW! Leave out if you have RFM69W!
                    #define ACK_TIME      30 // max # of ms to wait for an ack
                    #define LED           9  // Moteinos have LEDs on D9
                    #define SERIAL_BAUD   115200
                    
                    
                    RFM69 radio;
                    SPIFlash flash(8, 0xEF30); //EF40 for 16mbit windbond chip
                    bool promiscuousMode = false; //set to 'true' to sniff all packets on the same network
                    
                    
                    void setup() {
                      Serial.begin(SERIAL_BAUD);
                      delay(10);
                      radio.initialize(FREQUENCY,NODEID,NETWORKID);
                    #ifdef IS_RFM69HW
                      radio.setHighPower(); //uncomment only for RFM69HW!
                    #endif
                      radio.encrypt(ENCRYPTKEY);
                      radio.promiscuous(promiscuousMode);
                      char buff[50];
                      sprintf(buff, "\nListening at %d Mhz...", FREQUENCY==RF69_433MHZ ? 433 : FREQUENCY==RF69_868MHZ ? 868 : 915);
                      Serial.println(buff);
                      if (flash.initialize())
                        Serial.println("SPI Flash Init OK!");
                      else
                        Serial.println("SPI Flash Init FAIL! (is chip present?)");
                    }
                    
                    
                    byte ackCount=0;
                    void loop() {
                      //process any serial input
                      if (Serial.available() > 0)
                      {
                        char input = Serial.read();
                        if (input == 'r') //d=dump all register values
                          radio.readAllRegs();
                        if (input == 'E') //E=enable encryption
                          radio.encrypt(ENCRYPTKEY);
                        if (input == 'e') //e=disable encryption
                          radio.encrypt(null);
                        if (input == 'p')
                        {
                          promiscuousMode = !promiscuousMode;
                          radio.promiscuous(promiscuousMode);
                          Serial.print("Promiscuous mode ");Serial.println(promiscuousMode ? "on" : "off");
                        }
                        
                        if (input == 'd') //d=dump flash area
                        {
                          Serial.println("Flash content:");
                          int counter = 0;
                    
                    
                          while(counter<=256){
                            Serial.print(flash.readByte(counter++), HEX);
                            Serial.print('.');
                          }
                          while(flash.busy());
                          Serial.println();
                        }
                        if (input == 'D')
                        {
                          Serial.print("Deleting Flash chip content... ");
                          flash.chipErase();
                          while(flash.busy());
                          Serial.println("DONE");
                        }
                        if (input == 'i')
                        {
                          Serial.print("DeviceID: ");
                          word jedecid = flash.readDeviceId();
                          Serial.println(jedecid, HEX);
                        }
                        if (input == 't')
                        {
                          byte temperature =  radio.readTemperature(-1); // -1 = user cal factor, adjust for correct ambient
                          byte fTemp = 1.8 * temperature + 32; // 9/5=1.8
                          Serial.print( "Radio Temp is ");
                          Serial.print(temperature);
                          Serial.print("C, ");
                          Serial.print(fTemp); //converting to F loses some resolution, obvious when C is on edge between 2 values (ie 26C=78F, 27C=80F)
                          Serial.println('F');
                        }
                      }
                    
                    
                      if (radio.receiveDone())
                      {
                        Serial.print('[');Serial.print(radio.SENDERID, DEC);Serial.print("] ");
                        if (promiscuousMode)
                        {
                          Serial.print("to [");Serial.print(radio.TARGETID, DEC);Serial.print("] ");
                        }
                        for (byte i = 0; i < radio.DATALEN; i++)
                          Serial.print((char)radio.DATA[i]);
                        Serial.print("   [RX_RSSI:");Serial.print(radio.RSSI);Serial.print("]");
                        
                        if (radio.ACK_REQUESTED)
                        {
                          byte theNodeID = radio.SENDERID;
                          radio.sendACK();
                          Serial.print(" - ACK sent.");
                    
                    
                          // When a node requests an ACK, respond to the ACK
                          // and also send a packet requesting an ACK (every 3rd one only)
                          // This way both TX/RX NODE functions are tested on 1 end at the GATEWAY
                          if (ackCount++%3==0)
                          {
                            Serial.print(" Pinging node ");
                            Serial.print(theNodeID);
                            Serial.print(" - ACK...");
                            delay(3); //need this when sending right after reception .. ?
                            if (radio.sendWithRetry(theNodeID, "ACK TEST", 8, 0))  // 0 = only 1 attempt, no retries
                              Serial.print("ok!");
                            else Serial.print("nothing");
                          }
                          
                        }
                        Serial.println();
                        Blink(LED,3);
                      }
                    }
                    
                    
                    void Blink(byte PIN, int DELAY_MS)
                    {
                      pinMode(PIN, OUTPUT);
                      digitalWrite(PIN,HIGH);
                      delay(DELAY_MS);
                      digitalWrite(PIN,LOW);
                    }
                    Do you think this can be done?
                    </spiflash.h></spi.h></rfm69.h>

                    Comment


                    • Is this topic dead?

                      Comment


                      • Not really. Its just Greig has his sights on the HS3 version as well as family life. I am atempting to convert the ino to an NRF24l01 version. Not having good luck though. I do have it working on Xbee. ++++++

                        Comment


                        • Well I did order a couple of Moteinos and connected one, with a Gateway software in it, to Homeseer trough USB com port and the other, with a Node Software, is on my boiler shack, outside from my house. That Node is connected to a Ultrasound Ping Sensor and is measuring the level of my boiler tank level, which I can now see on my Homeseer HSTouch panel as a percentage. When the level reaches 10%, Homeseer sends me an SMS. I have also connected a DS18S20 Temperature Probe to this node and it is sending my boiler temperature to Homeseer too. Now I turn on the boiler and when the water is hot, Homeseer announces in the house.

                          After this I have used another Node with an RFID sensor to open the external gate with an RFID Tag. Now I know when everybody arrives at my house. The gardener has also a tag but he can only open the gate in a certain day of the week and in a preset hour range. If that tag tries to open the gate outside this scheduled time, it won't work and I get an SMS advising me that someone tried to get in.

                          Another node is connected to my garage door and yet another one to my Main Gate. I'm now in the processes of getting another connected to my car passing lights so that I can open both gates with a flash of the light. One flash outer gate opens, two flashes the garage door opens.

                          Moteinos are very easy to use with Homeseer and can be used for almost everything.

                          Comment


                          • Originally posted by luisr320 View Post
                            Well I did order a couple of Moteinos and connected one, with a Gateway software in it, to Homeseer trough USB com port and the other, with a Node Software, is on my boiler shack, outside from my house. That Node is connected to a Ultrasound Ping Sensor and is measuring the level of my boiler tank level, which I can now see on my Homeseer HSTouch panel as a percentage. When the level reaches 10%, Homeseer sends me an SMS. I have also connected a DS18S20 Temperature Probe to this node and it is sending my boiler temperature to Homeseer too. Now I turn on the boiler and when the water is hot, Homeseer announces in the house.

                            After this I have used another Node with an RFID sensor to open the external gate with an RFID Tag. Now I know when everybody arrives at my house. The gardener has also a tag but he can only open the gate in a certain day of the week and in a preset hour range. If that tag tries to open the gate outside this scheduled time, it won't work and I get an SMS advising me that someone tried to get in.

                            Another node is connected to my garage door and yet another one to my Main Gate. I'm now in the processes of getting another connected to my car passing lights so that I can open both gates with a flash of the light. One flash outer gate opens, two flashes the garage door opens.

                            Moteinos are very easy to use with Homeseer and can be used for almost everything.
                            How do they connect to hs ? With wire or wireless?

                            Comment


                            • One Moteino is considered the Gateway and is connected to my Homeseer computer trough a USB cable. For the Gateway I use the USB Moteino version, which has a FTDI chip and a mini B USB port on it. It costs a bit more but totally worth it. The Nodes don't have the USB connectivity unless you plug in one of those USB/Com converters/adapters with the FTDI chip on them, which you need in order to program it.



                              Once it is programmed, the node connects to a 3.3v or 5v power supply and it will connect to the Gateway wirelessly. The radios on them come in tree different frequencies, that you choose according to your country restrictions. All the Moteinos must be in the same frequency. They are identified from each other by a node number. It's like a Xbee.


                              If you order the Moteinos with the optional Flash chip in it, you will be able to reprogram them wirelessly.


                              I use Homeseer COM functions to read the Serial.write() commands from the Gateway that goes trough the USB port and act upon what comes trough. And I use events to send commands trough the COM port to the Gateway that will read them with a Serial.read().


                              You can see more information on the Moteinos here:
                              http://lowpowerlab.com/moteino/
                              I'm not affiliated with them in any way.





                              If you want I can explain a bit more how to interface Homeseer with the Gateway.

                              Comment


                              • That Would be great.
                                Cheap Wireless io-boards with 5-10 IO ports that Can be controlled in hs3 Would be great!

                                Comment

                                Working...
                                X