Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. My Project
  3. Power/ Usage sensor - multi channel - local display

Power/ Usage sensor - multi channel - local display

Scheduled Pinned Locked Moved My Project
41 Posts 6 Posters 19.6k Views 7 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • mfalkviddM Offline
    mfalkviddM Offline
    mfalkvidd
    Mod
    wrote on last edited by
    #28

    With MySensors version 1.6 (currently in development) you can connect the Arduino to the Raspberry Pi's USB port using a FTDI or CH340G. That type of connection is called a serial gateway. Before 1.6, the gateways do not support local sensors.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      MarkV
      wrote on last edited by MarkV
      #29

      So with 1.6 i can install the master software and connect my arduino master directly through usb without the rf24''s? ?

      1 Reply Last reply
      0
      • mfalkviddM Offline
        mfalkviddM Offline
        mfalkvidd
        Mod
        wrote on last edited by
        #30

        I am not entirely sure what a master is, but yes, I think you can.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          MarkV
          wrote on last edited by MarkV
          #31

          I meen the master sketch like written above.

          I'd want to build a gateway but without the wireless RF part, just connect the master arduino directly through usb to the RasberryPi and readout the measurements.

          So in general:

          Kwh Meters -- cable --> Slave arduino <-- serial --> Master arduino <-- USB --> RasberryPi

          AWIA 1 Reply Last reply
          0
          • M MarkV

            I meen the master sketch like written above.

            I'd want to build a gateway but without the wireless RF part, just connect the master arduino directly through usb to the RasberryPi and readout the measurements.

            So in general:

            Kwh Meters -- cable --> Slave arduino <-- serial --> Master arduino <-- USB --> RasberryPi

            AWIA Offline
            AWIA Offline
            AWI
            Hero Member
            wrote on last edited by
            #32

            @MarkV If you don't want it to be MySensors enabled and not used the display etc. it's easier to readout the slave with the raspberry. The protocol is a simple Json and if you use a nano for the slave you can connect it with usb..

            1 Reply Last reply
            0
            • M Offline
              M Offline
              MarkV
              wrote on last edited by MarkV
              #33

              Last weeks i'm trying to get it to work but without luck. Could you give a manual on how to get it working with json? What should we do? And how? On my rasberry, on the arduino and in domoticz??

              1 Reply Last reply
              0
              • AWIA AWI

                @FotoFieber To be honest .. a left over from some experiments. Just leave it out... you won't notice the difference.

                M Offline
                M Offline
                MarkV
                wrote on last edited by MarkV
                #34

                @AWI
                Goodmorning,
                I've got a question, are you planning to re-write the script for the main and slave Arduino to the new MySensors 2.0 structuur?

                I've also tryed to look on github if there's a page from you, but didn't find it...

                AWIA 1 Reply Last reply
                0
                • M MarkV

                  @AWI
                  Goodmorning,
                  I've got a question, are you planning to re-write the script for the main and slave Arduino to the new MySensors 2.0 structuur?

                  I've also tryed to look on github if there's a page from you, but didn't find it...

                  AWIA Offline
                  AWIA Offline
                  AWI
                  Hero Member
                  wrote on last edited by AWI
                  #35

                  @MarkV I updated the sketch for main a few months ago to development (pre-2.0). Also changed it a little for stability and removed the (complicated) JSON library The slave has no MySensors dependency.

                  M 1 Reply Last reply
                  0
                  • M Offline
                    M Offline
                    MarkV
                    wrote on last edited by
                    #36

                    Super.
                    I've updated everything and it's up and running.
                    But my Master arduino (UNO clone) gives this readout on the USB port:

                    0;255;3;0;14;Gateway startup complete.
                    0;255;3;0;11;AWI-12ChannelPulse
                    0;255;3;0;12;2.0
                    0;0;0;0;13;Groep 1
                    0;1;0;0;13;Groep 2
                    0;2;0;0;13;Groep 3
                    0;3;0;0;13;Groep 4
                    0;4;0;0;13;Groep 5
                    0;5;0;0;13;Groep 6
                    0;20;0;0;36;Usage meter LCD
                    0;20;1;0;47;-
                    0;255;3;0;1;
                    0;255;3;0;1;
                    0;0;1;0;17;0
                    0;0;1;0;18;-0.001
                    0;255;3;0;1;
                    0;1;1;0;17;0
                    0;1;1;0;18;-0.001
                    0;255;3;0;1;
                    0;2;1;0;17;0
                    0;2;1;0;18;-0.001
                    0;255;3;0;1;
                    0;3;1;0;17;0
                    0;3;1;0;18;-0.001
                    0;255;3;0;1;
                    0;4;1;0;17;0
                    0;4;1;0;18;-0.001
                    0;255;3;0;1;
                    0;5;1;0;17;0
                    0;5;1;0;18;-0.001
                    0;255;3;0;1;
                    0;0;1;0;17;0
                    0;0;1;0;18;-0.001
                    0;255;3;0;1;
                    0;1;1;0;17;0
                    0;1;1;0;18;-0.001
                    0;255;3;0;1;
                    0;2;1;0;17;0
                    0;2;1;0;18;-0.001
                    0;20;2;0;47;
                    0;255;3;0;1;
                    0;3;1;0;17;0
                    0;3;1;0;18;-0.001
                    0;255;3;0;1;
                    0;4;1;0;17;0
                    0;4;1;0;18;-0.001
                    0;255;3;0;1;
                    0;5;1;0;17;0
                    0;5;1;0;18;-0.001
                    0;255;3;0;1;
                    0;0;1;0;17;0
                    0;0;1;0;18;-0.001
                    0;255;3;0;1;
                    0;1;1;0;17;0
                    0;1;1;0;18;-0.001
                    0;255;3;0;1;
                    0;2;1;0;17;0
                    0;2;1;0;18;-0.001
                    0;255;3;0;1;
                    0;3;1;0;17;0
                    0;3;1;0;18;-0.001
                    0;255;3;0;1;
                    0;4;1;0;17;0
                    0;4;1;0;18;-0.001
                    0;255;3;0;1;
                    0;5;1;0;17;0
                    0;5;1;0;18;-0.001
                    0;255;3;0;1;
                    0;0;1;0;17;0
                    0;0;1;0;18;-0.001
                    0;20;2;0;47;
                    0;255;3;0;1;
                    0;1;1;0;17;0
                    0;1;1;0;18;-0.001
                    0;255;3;0;1;
                    0;2;1;0;17;0
                    0;2;1;0;18;-0.001
                    0;255;3;0;1;
                    0;3;1;0;17;0
                    0;3;1;0;18;-0.001
                    0;255;3;0;1;
                    0;4;1;0;17;0
                    0;4;1;0;18;-0.001
                    0;255;3;0;1;
                    0;5;1;0;17;0
                    0;5;1;0;18;-0.001
                    0;255;3;0;1;
                    0;0;1;0;17;0
                    0;0;1;0;18;-0.001
                    0;255;3;0;1;
                    0;1;1;0;17;0
                    0;1;1;0;18;-0.001
                    0;255;3;0;1;
                    0;2;1;0;17;0
                    0;2;1;0;18;-0.001
                    0;255;3;0;1;
                    0;3;1;0;17;0
                    0;3;1;0;18;-0.001
                    0;255;3;0;1;
                    0;4;1;0;17;0
                    0;4;1;0;18;-0.001
                    0;20;2;0;47;
                    0;255;3;0;1;
                    0;5;1;0;17;0
                    0;5;1;0;18;-0.001
                    0;255;3;0;1;
                    0;0;1;0;17;0
                    0;0;1;0;18;-0.001
                    0;255;3;0;1;
                    0;1;1;0;17;0
                    0;1;1;0;18;-0.001
                    0;255;3;0;1;
                    0;2;1;0;17;0
                    0;2;1;0;18;-0.001
                    0;255;3;0;1;
                    0;3;1;0;17;0
                    0;3;1;0;18;-0.001
                    0;255;3;0;1;
                    0;4;1;0;17;0
                    0;4;1;0;18;-0.001
                    0;255;3;0;1;
                    0;5;1;0;17;0
                    0;5;1;0;18;-0.001
                    0;255;3;0;1;
                    0;0;1;0;17;0
                    0;0;1;0;18;-0.001
                    0;255;3;0;1;
                    0;1;1;0;17;0
                    0;1;1;0;18;-0.001
                    0;255;3;0;1;
                    0;2;1;0;17;0
                    0;2;1;0;18;-0.001
                    0;20;2;0;47;
                    0;255;3;0;1;
                    0;3;1;0;17;0
                    0;3;1;0;18;-0.001
                    0;255;3;0;1;
                    0;4;1;0;17;0
                    0;4;1;0;18;-0.001
                    0;255;3;0;1;
                    0;5;1;0;17;0
                    0;5;1;0;18;-0.001
                    0;255;3;0;1;
                    0;0;1;0;17;0
                    0;0;1;0;18;-0.001
                    0;255;3;0;1;
                    0;1;1;0;17;0
                    0;1;1;0;18;-0.001
                    0;255;3;0;1;
                    0;2;1;0;17;0
                    0;2;1;0;18;-0.001
                    0;255;3;0;1;
                    0;3;1;0;17;0
                    0;3;1;0;18;-0.001
                    0;255;3;0;1;
                    0;4;1;0;17;0
                    0;4;1;0;18;-0.001
                    0;255;3;0;1;
                    0;5;1;0;17;0
                    0;5;1;0;18;-0.001
                    0;255;3;0;1;
                    0;0;1;0;17;0
                    0;0;1;0;18;-0.001
                    0;20;2;0;47;
                    0;255;3;0;1;
                    0;1;1;0;17;0
                    0;1;1;0;18;-0.001
                    0;255;3;0;1;
                    0;2;1;0;17;0
                    0;2;1;0;18;-0.001
                    0;255;3;0;1;
                    0;3;1;0;17;0
                    0;3;1;0;18;-0.001
                    0;255;3;0;1;
                    0;4;1;0;17;0
                    0;4;1;0;18;-0.001
                    0;255;3;0;1;
                    0;5;1;0;17;0
                    0;5;1;0;18;-0.001
                    0;255;3;0;1;
                    0;0;1;0;17;0
                    0;0;1;0;18;-0.001
                    0;255;3;0;1;
                    0;1;1;0;17;0
                    0;1;1;0;18;-0.001
                    0;255;3;0;1;
                    0;2;1;0;17;0
                    0;2;1;0;18;-0.001
                    0;255;3;0;1;
                    0;3;1;0;17;0
                    0;3;1;0;18;-0.001
                    0;255;3;0;1;
                    0;4;1;0;17;0
                    0;4;1;0;18;-0.001
                    0;20;2;0;47;
                    0;255;3;0;1;
                    0;5;1;0;17;0
                    0;5;1;0;18;-0.001
                    0;255;3;0;1;
                    0;0;1;0;17;0
                    0;0;1;0;18;-0.001
                    0;255;3;0;1;
                    0;1;1;0;17;0
                    0;1;1;0;18;-0.001
                    0;255;3;0;1;
                    0;2;1;0;17;0
                    0;2;1;0;18;-0.001
                    0;255;3;0;1;
                    0;3;1;0;17;0
                    0;3;1;0;18;-0.001
                    0;255;3;0;1;
                    0;4;1;0;17;0
                    0;4;1;0;18;-0.001
                    0;255;3;0;1;
                    0;5;1;0;17;0
                    0;5;1;0;18;-0.001
                    0;255;3;0;1;
                    0;0;1;0;17;0
                    0;0;1;0;18;-0.001
                    0;255;3;0;1;
                    0;1;1;0;17;0
                    0;1;1;0;18;-0.001
                    0;255;3;0;1;
                    0;2;1;0;17;0
                    0;2;1;0;18;-0.001
                    0;20;2;0;47;
                    0;255;3;0;1;
                    0;3;1;0;17;0
                    0;3;1;0;18;-0.001
                    0;255;3;0;1;
                    0;4;1;0;17;0
                    0;4;1;0;18;-0.001
                    0;255;3;0;1;
                    0;5;1;0;17;0
                    0;5;1;0;18;-0.001
                    0;255;3;0;1;
                    0;0;1;0;17;0
                    0;0;1;0;18;-0.001
                    0;255;3;0;1;
                    0;1;1;0;17;0
                    0;1;1;0;18;-0.001
                    0;255;3;0;1;
                    0;2;1;0;17;0
                    0;2;1;0;18;-0.001
                    0;255;3;0;1;
                    0;3;1;0;17;0
                    0;3;1;0;18;-0.001
                    0;255;3;0;1;
                    0;4;1;0;17;0
                    0;4;1;0;18;-0.001
                    0;255;3;0;1;
                    0;5;1;0;17;0
                    0;5;1;0;18;-0.001
                    0;255;3;0;1;
                    0;0;1;0;17;0
                    0;0;1;0;18;-0.001
                    0;20;2;0;47;
                    0;255;3;0;1;
                    0;1;1;0;17;0
                    0;1;1;0;18;-0.001
                    0;255;3;0;1;
                    0;2;1;0;17;0
                    0;2;1;0;18;-0.001
                    0;255;3;0;1;
                    0;3;1;0;17;0
                    0;3;1;0;18;-0.001
                    0;255;3;0;1;
                    0;4;1;0;17;0
                    0;4;1;0;18;-0.001
                    0;255;3;0;1;
                    0;5;1;0;17;0
                    0;5;1;0;18;-0.001
                    0;255;3;0;1;
                    0;0;1;0;17;0
                    0;0;1;0;18;-0.001
                    0;255;3;0;1;
                    0;1;1;0;17;0
                    0;1;1;0;18;-0.001
                    0;255;3;0;1;
                    0;2;1;0;17;0
                    0;2;1;0;18;-0.001
                    0;255;3;0;1;
                    0;3;1;0;17;0
                    0;3;1;0;18;-0.001
                    0;255;3;0;1;
                    0;4;1;0;17;0
                    0;4;1;0;18;-0.001
                    0;20;2;0;47;
                    0;255;3;0;1;
                    0;5;1;0;17;0
                    0;5;1;0;18;-0.001
                    0;255;3;0;1;
                    0;0;1;0;17;0
                    0;0;1;0;18;-0.001
                    0;255;3;0;1;
                    0;1;1;0;17;0
                    0;1;1;0;18;-0.001
                    0;255;3;0;1;
                    0;2;1;0;17;0
                    0;2;1;0;18;-0.001
                    0;255;3;0;1;
                    0;3;1;0;17;0
                    0;3;1;0;18;-0.001
                    0;255;3;0;1;
                    0;4;1;0;17;0
                    0;4;1;0;18;-0.001
                    0;255;3;0;1;
                    0;5;1;0;17;0
                    0;5;1;0;18;-0.001
                    0;255;3;0;1;
                    0;0;1;0;17;0
                    0;0;1;0;18;-0.001
                    0;255;3;0;1;
                    0;1;1;0;17;0
                    0;1;1;0;18;-0.001
                    0;255;3;0;1;
                    0;2;1;0;17;0
                    0;2;1;0;18;-0.001
                    0;20;2;0;47;
                    0;255;3;0;1;
                    0;3;1;0;17;0
                    0;3;1;0;18;-0.001
                    0;255;3;0;1;
                    0;4;1;0;17;0
                    0;4;1;0;18;-0.001
                    0;255;3;0;1;
                    0;5;1;0;17;0
                    0;5;1;0;18;-0.001
                    0;255;3;0;1;
                    0;0;1;0;17;0
                    0;0;1;0;18;-0.001
                    0;255;3;0;1;
                    0;1;1;0;17;0
                    0;1;1;0;18;-0.001
                    0;255;3;0;1;
                    0;2;1;0;17;0
                    0;2;1;0;18;-0.001
                    0;255;3;0;1;
                    0;3;1;0;17;0
                    0;3;1;0;18;-0.001
                    0;255;3;0;1;
                    0;4;1;0;17;0
                    0;4;1;0;18;-0.001
                    0;255;3;0;1;
                    0;5;1;0;17;0
                    0;5;1;0;18;-0.001
                    0;255;3;0;1;
                    0;0;1;0;17;0
                    0;0;1;0;18;-0.001
                    0;20;2;0;47;
                    0;255;3;0;1;
                    0;1;1;0;17;0
                    0;1;1;0;18;-0.001
                    0;255;3;0;1;
                    0;2;1;0;17;0
                    0;2;1;0;18;-0.001
                    0;255;3;0;1;
                    0;3;1;0;17;0
                    0;3;1;0;18;-0.001
                    0;255;3;0;1;
                    0;4;1;0;17;0
                    0;4;1;0;18;-0.001
                    0;255;3;0;1;
                    0;5;1;0;17;0
                    0;5;1;0;18;-0.001
                    0;255;3;0;1;
                    0;0;1;0;17;0
                    0;0;1;0;18;-0.001
                    0;255;3;0;1;
                    0;1;1;0;17;0
                    0;1;1;0;18;-0.001
                    0;255;3;0;1;
                    0;2;1;0;17;0
                    0;2;1;0;18;-0.001
                    0;255;3;0;1;
                    0;3;1;0;17;0
                    0;3;1;0;18;-0.001
                    0;255;3;0;1;
                    0;4;1;0;17;0
                    0;4;1;0;18;-0.001
                    0;20;2;0;47;
                    0;255;3;0;1;
                    0;5;1;0;17;0
                    0;5;1;0;18;-0.001
                    0;255;3;0;1;
                    0;0;1;0;17;0
                    0;0;1;0;18;-0.001
                    

                    Is this correct?
                    Because Domoticz doesn't change the values.
                    Also this is not the format, wich is past through in the JSON code from the slave to master duino??

                    1 Reply Last reply
                    0
                    • AWIA AWI

                      @MarkV I updated the sketch for main a few months ago to development (pre-2.0). Also changed it a little for stability and removed the (complicated) JSON library The slave has no MySensors dependency.

                      M Offline
                      M Offline
                      MarkV
                      wrote on last edited by
                      #37

                      @AWI
                      How is it that i get the readings like above? And after a while the sensor also stops with sending data, last connection stays on that time and date.

                      I've uploaded your github sketch and done a serial readout of the measuring arduino and that one functions proberbly. No faulty low voltage errors etc.

                      AWIA 1 Reply Last reply
                      0
                      • M MarkV

                        @AWI
                        How is it that i get the readings like above? And after a while the sensor also stops with sending data, last connection stays on that time and date.

                        I've uploaded your github sketch and done a serial readout of the measuring arduino and that one functions proberbly. No faulty low voltage errors etc.

                        AWIA Offline
                        AWIA Offline
                        AWI
                        Hero Member
                        wrote on last edited by
                        #38

                        @MarkV Ok, one step at a time.. the output looks like the output of your (serial) gateway. Have you tried to switch on the "Master node" debug Serial.print() statements?

                        M 1 Reply Last reply
                        0
                        • AWIA AWI

                          @MarkV Ok, one step at a time.. the output looks like the output of your (serial) gateway. Have you tried to switch on the "Master node" debug Serial.print() statements?

                          M Offline
                          M Offline
                          MarkV
                          wrote on last edited by
                          #39

                          @AWI
                          It the serial output from the gateway arduino, wich i've got connected through usb.
                          I don't have a rotaryswitch connected and yesterday evening i connected a I2c Display just to see if something changes on that.

                          I noticed one thin, when i check the serial output, the timer on the display is reset. Further more when i stop the serial readout, the counter also stops, like if the hole thing go's into a idle or stop.

                          I've uncommented the debug informatie wich i could find:

                          // Handle incoming messages from the MySensors Gateway
                          void receive(const MyMessage &message) {  // Expect few types of messages from controller, V_VAR1 for messages
                            if (message.type==V_TEXT) {
                              // if message comes in, update the kWH reading for meter with value since last update
                              // Write some debug info
                              Serial.print("Last reading for sensor: ");
                              Serial.print(message.sensor);                
                              Serial.print(", Message: ");
                              Serial.println(message.getString());
                              if (message.sensor == LCD1_CHILD ) {
                                strcpy(lastLCD1, message.getString());  // read payload in LCD string
                              }
                            }
                          }
                          

                          Were could i read this debug information?
                          At this moment i got my arduino hooked up through usb to my rasberry to see if it keeps sending information.

                          I also changed all the cables to the meters.

                          This is how one meter looks like:
                          0_1462289685255_upload-a785d675-02ea-45c7-9888-2616d6a5c4f4

                          And a other one:
                          0_1462289751196_upload-ac4e8673-e392-43ac-aeea-1be31416479a

                          All the meters are showing also strange values on the axis.

                          Sorry for being such a noob at this.. :-S

                          AWIA 1 Reply Last reply
                          0
                          • M MarkV

                            @AWI
                            It the serial output from the gateway arduino, wich i've got connected through usb.
                            I don't have a rotaryswitch connected and yesterday evening i connected a I2c Display just to see if something changes on that.

                            I noticed one thin, when i check the serial output, the timer on the display is reset. Further more when i stop the serial readout, the counter also stops, like if the hole thing go's into a idle or stop.

                            I've uncommented the debug informatie wich i could find:

                            // Handle incoming messages from the MySensors Gateway
                            void receive(const MyMessage &message) {  // Expect few types of messages from controller, V_VAR1 for messages
                              if (message.type==V_TEXT) {
                                // if message comes in, update the kWH reading for meter with value since last update
                                // Write some debug info
                                Serial.print("Last reading for sensor: ");
                                Serial.print(message.sensor);                
                                Serial.print(", Message: ");
                                Serial.println(message.getString());
                                if (message.sensor == LCD1_CHILD ) {
                                  strcpy(lastLCD1, message.getString());  // read payload in LCD string
                                }
                              }
                            }
                            

                            Were could i read this debug information?
                            At this moment i got my arduino hooked up through usb to my rasberry to see if it keeps sending information.

                            I also changed all the cables to the meters.

                            This is how one meter looks like:
                            0_1462289685255_upload-a785d675-02ea-45c7-9888-2616d6a5c4f4

                            And a other one:
                            0_1462289751196_upload-ac4e8673-e392-43ac-aeea-1be31416479a

                            All the meters are showing also strange values on the axis.

                            Sorry for being such a noob at this.. :-S

                            AWIA Offline
                            AWIA Offline
                            AWI
                            Hero Member
                            wrote on last edited by
                            #40

                            @MarkV Hi Mark It is a rather complicated sketch, so not easy to debug remote.
                            You need to connect the master arduino to your USB and check with the serial monitor.
                            then add some Serial.print() statements starting form where the data is read.

                            The piece you commented out is where the node should receive information from the controller. I expect you didn't come far enough to set that up.

                            (as I noticed you are Dutch, we can use the chat function on the forum to get this working...please don't expect immediate answers..)

                            M 1 Reply Last reply
                            0
                            • AWIA AWI

                              @MarkV Hi Mark It is a rather complicated sketch, so not easy to debug remote.
                              You need to connect the master arduino to your USB and check with the serial monitor.
                              then add some Serial.print() statements starting form where the data is read.

                              The piece you commented out is where the node should receive information from the controller. I expect you didn't come far enough to set that up.

                              (as I noticed you are Dutch, we can use the chat function on the forum to get this working...please don't expect immediate answers..)

                              M Offline
                              M Offline
                              MarkV
                              wrote on last edited by
                              #41

                              @AWI
                              Goodevening
                              Oh better, we definitie have to de that. When does it suit you?

                              Grtz

                              1 Reply Last reply
                              0
                              Reply
                              • Reply as topic
                              Log in to reply
                              • Oldest to Newest
                              • Newest to Oldest
                              • Most Votes


                              13

                              Online

                              11.7k

                              Users

                              11.2k

                              Topics

                              113.1k

                              Posts


                              Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                              • Login

                              • Don't have an account? Register

                              • Login or register to search.
                              • First post
                                Last post
                              0
                              • MySensors
                              • OpenHardware.io
                              • Categories
                              • Recent
                              • Tags
                              • Popular