Power/ Usage sensor - multi channel - local display
-
Arduino: 1.6.5 (Windows 7), Board:"Arduino Nano, ATmega328"
sketch_oct03e:128: error: 'V_TEXT' was not declared in this scope
sketch_oct03e.ino: In function 'void setup()':
sketch_oct03e:162: error: 'S_INFO' was not declared in this scope
sketch_oct03e.ino: In function 'void loop()':
sketch_oct03e:337: error: 'V_TEXT' was not declared in this scope
sketch_oct03e.ino: In function 'void incomingMessage(const MyMessage&)':
sketch_oct03e:364: error: 'V_TEXT' was not declared in this scope
'V_TEXT' was not declared in this scopeDit rapport zou meer informatie hebben met
"Tijdens de compilatie uitgebreide uitvoer weergeven"
ingeschakeld in Bestand > Voorkeuren. -
Arduino: 1.6.5 (Windows 7), Board:"Arduino Nano, ATmega328"
sketch_oct03e:128: error: 'V_TEXT' was not declared in this scope
sketch_oct03e.ino: In function 'void setup()':
sketch_oct03e:162: error: 'S_INFO' was not declared in this scope
sketch_oct03e.ino: In function 'void loop()':
sketch_oct03e:337: error: 'V_TEXT' was not declared in this scope
sketch_oct03e.ino: In function 'void incomingMessage(const MyMessage&)':
sketch_oct03e:364: error: 'V_TEXT' was not declared in this scope
'V_TEXT' was not declared in this scopeDit rapport zou meer informatie hebben met
"Tijdens de compilatie uitgebreide uitvoer weergeven"
ingeschakeld in Bestand > Voorkeuren. -
Arduino: 1.6.5 (Windows 7), Board:"Arduino Nano, ATmega328"
sketch_oct03e:128: error: 'V_TEXT' was not declared in this scope
sketch_oct03e.ino: In function 'void setup()':
sketch_oct03e:162: error: 'S_INFO' was not declared in this scope
sketch_oct03e.ino: In function 'void loop()':
sketch_oct03e:337: error: 'V_TEXT' was not declared in this scope
sketch_oct03e.ino: In function 'void incomingMessage(const MyMessage&)':
sketch_oct03e:364: error: 'V_TEXT' was not declared in this scope
'V_TEXT' was not declared in this scopeDit rapport zou meer informatie hebben met
"Tijdens de compilatie uitgebreide uitvoer weergeven"
ingeschakeld in Bestand > Voorkeuren.@marten You need to use the "Development" branch of MySensors until the production version gets updated -or- you can uncomment the lines with "const int ..."
// new V_TEXT variable type (development 20150905) //const int V_TEXT = 47 ; // new S_INFO sensor type (development 20150905) //const int S_INFO = 36 ; -
@AWI thanks again!
I am using your sketches with only one S0 Meter (the 2000pulse/kwh one).
*One thing i just found out, that as long as the master arduino is connected to the serial port of my pc it is running fine but when its not, it does not send.I have checked the voltage at the radio and it is the same... I also do not have any display or rotary encoder, as I do the visualisation with FHEM.
Do you know why this is the case? * -> Voltage was to low... but the secon question remains:Any idea to use differen pulses/kwh S0 meters? for example one 2000pulse/kwh and one 800 pulse/kwh.
thanks in advance!@jeti as mentioned in a previous post..
There are a few ways of getting it changed:
You can keep/ leave most as it is and when you send/ or display the values divide the pulses by two and double the Watt values in the routines "LCD_local_display" and "sendPowerUpdate"
or: make the necessary calculations when the data comes in. This is a little more complicated in routine "storeMeterJSON" but if you understand the logic (including error corrrection) should be not too hard.
I don't have the time at this moment to do it for you...
-
@jeti as mentioned in a previous post..
There are a few ways of getting it changed:
You can keep/ leave most as it is and when you send/ or display the values divide the pulses by two and double the Watt values in the routines "LCD_local_display" and "sendPowerUpdate"
or: make the necessary calculations when the data comes in. This is a little more complicated in routine "storeMeterJSON" but if you understand the logic (including error corrrection) should be not too hard.
I don't have the time at this moment to do it for you...
-
was not that much work :smiley:
this is the modified master-sketch from AWI i am starting to use. The changes i made:
-deletion of LCD and rotray part
-deletion of accumulation part
-modified meterType to meter800, meter1000 and meter2000 this reflects meters with 800imp/khw;1000imp/kwh;2000imp/kwhI am using this with only one meter (2000imp/kwh) for now and works pretty nicly second different meter type is on the way.
As I am a beginner please be gentle with comments :-)
#include <MySensor.h> // MySensors network #include <SPI.h> #include <Time.h> #include <ArduinoJson.h> // used to parse the simple JSON output of the pulse meter https://github.com/bblanchon/ArduinoJson // Constants & globals const int NO_METERS = 1 ; // actual meters used (max 12) const int NODE_ID = 152 ; // fixed MySensors node ID const int JSON_LENGHT = 80 ; // Maximum json string length // new V_TEXT variable type (development 20150905) const int V_TEXT = 47 ; // new S_INFO sensor type (development 20150905) const int S_INFO = 36 ; char lastLCD1[21] = "-- "; // LCD message line typedef enum meterTypes: int8_t {meter800, meter1000, meter2000} ; // metertype meter800, meter1000, meter2000; const char METER_NAMES[NO_METERS][4] = {"PC"} ; // meter names const meterTypes METER_TYPES[NO_METERS] = {meter2000}; const unsigned long idleTime = 10000 ; // Delay time for any of the states to return to idle unsigned long idleTimer ; // Delay timer for idleTime union { // used to convert long to bytes for EEPROM storage long kWhLongInt; uint8_t kWhLongByte[4]; } kWhLong ; // Possible states for the state machine. // Idle: default state, show totals for in/out nett // Browse: dive into meter details // Update: update meter value (Wh total) // Reset: reset day values enum States: int8_t {IDLE, BROWSE, UPDATE, RST} ; uint8_t State = IDLE; // current state machine state // meter class, store all relevant meter data (equivalent to struct) class pulseMeter { public: long UsageWh; // last (current) usage (in W) from pulse counter long UsageAccumWh; // usage accumulator (to keep in sync) from pulse counter long PowerW; // actual power, calculated from pulse "rate" long DayUsageWh; // daily usage for display meterTypes Type; // metertype for addition in totals: meter800, meter1000, meter2000; char Name[4] ; // meter name for display }; pulseMeter pulseMeters[NO_METERS] ; // define power meters //pulseMeter meter800, meter1000, meter2000; // pulse/kWh unsigned long tempUsageWh ; // temporary store while manually updating (state UPDATE) // Json parser: define parse object: <10> = number of tokens in JSON: ~10 per m (4 * [key, value] + key_total, value_total)) // example: "{\"m\":1,\"c\":12,\"r\":120000,\"cA\":12345}" char json[JSON_LENGHT] ; // Storage for serial JSON string (init for example) // flags & counters bool timeReceived = false; // controller time bool newDay = false; // reset at 00:00:00 unsigned long lastUpdate=0, lastRequest=0, lastDisplay=0, lastSyncKWH=0; // loop timers for once in while events int updateMeter = 0; // current meter for update bool updateDisplayFlag = true ; // indicate that display needs to be updated int currentMeter = 0; // active meter for update & check, cycles through meters (0..NO_METERS-1) int lastRotary = 0; // last rotary encoder position int updateIncrement = 1000 ; // Interval multiplier for Update int errCount = 0 ; // error counter // *** Definition and initialisation // define the MySensor network MySensor gw; // pins used RFX24(default 9,10) // Initialize messages for sensor network MyMessage powerMsg(0,V_WATT); // message to send power in W MyMessage usageMsg(0,V_KWH); // message to send usage in kWH MyMessage textMsg(0,V_TEXT); // message to send/receive text // function to reset the Arduino (jump to 0 address) void(* resetFunc) (void) = 0;//declare reset function at address 0 void setup(void) { gw.begin(incomingMessage, NODE_ID, false); // this node is fixed, no repeat //Send the sensor node sketch version information to the gateway gw.sendSketchInfo("AWI-12ChannelPulse", "2.0"); // Initialize the meter names // Register all Pulse counters to gw (they will be created as child devices from 0 to MAX-1) for (int x = 0; x < NO_METERS; x++){ gw.present(x, S_POWER, METER_NAMES[x]); // present power meters to gateway delay(10); // give it some time to process } delay(100); for (int x = 0; x < NO_METERS; x++){ // initialize previous kWh values from EEPROM and init for (int y = 0; y < 4 ; y++){ // convert from bytes kWhLong.kWhLongByte[y]= gw.loadState(x *4 + y) ;// EEPROM position = meter number * 4 bytes } // controller is updated later automatically pulseMeters[x].UsageWh = kWhLong.kWhLongInt; strcpy(pulseMeters[x].Name, METER_NAMES[x] ); // copy string for meter names pulseMeters[x].Type = METER_TYPES[x]; // Set type } } void loop(void) { // Before specific states, perform generic tasks unsigned long now = millis(); // Timer in loop for "once in a while" events gw.process() ; // process incoming messages // If no time has been received yet, request it every 10 second from controller if ((!timeReceived && (now-lastRequest > 10*1000)) || (now-lastRequest > 3600000UL)){ // request update every hour to keep in sync Serial.println(F("requesting time")); // Request time from controller. timeReceived = false; gw.requestTime(receiveTime); lastRequest = now; } // Check if new day has started (hour == 0) and reset day usage counters of meters if (hour()==0 && !newDay){ newDay = true; for (int x = 0; x < NO_METERS; x++){ pulseMeters[x].DayUsageWh = 0 ; // reset daily counters saveMeters(x); // save meter values to EEPROM } } else if(hour() != 0 && newDay) // reset newday flag if hour != 0 { newDay = false;} // Every 10 seconds update one meter to controller to avoid traffic jams if (now-lastSyncKWH > 10000){ // printPulsemeter(updateMeter); sendPowerUpdate(updateMeter); // update the values for currentMeter updateMeter++ ; if (updateMeter >= NO_METERS){ // increment and wrap current meter updateMeter = 0 ;} lastSyncKWH = now ; } // Update sensors every 10 secs if (now-lastUpdate > 10000) { // get values to be displayed from controller lastUpdate = now; } // get readings from serial (sent every 10s) // format {"m":meter,"c":count,"r":rate, "cA":countAccum} // use JSON parser to process (could be replaced by simple split routine, but this works just fine) if(readLineJSON(Serial.read(), json, JSON_LENGHT) > 0 ){ //dummySerial(), Serial.read() // if(readLineJSON(dummySerial(), json, 80) > 0 ){ //dummySerial(), Serial.read() Serial.println(json); storeMeterJSON(json); //store the meter reading //calcMeterTotals(); // update totals } } // This is called when a new time value was received void receiveTime(unsigned long controllerTime) { // Ok, set incoming time Serial.print(F("Time value received: ")); Serial.println(controllerTime); setTime(controllerTime); // set the clock to the time from controller timeReceived = true ; } // This is called when a message is received void incomingMessage(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()); } } // save Meter to EEPROM when needed void saveMeters(int8_t meterNo){ kWhLong.kWhLongInt = pulseMeters[meterNo].UsageWh ; // convert to separate bytes via struct for (int y = 0; y < 4 ; y++){ gw.saveState(meterNo * 4 + y, kWhLong.kWhLongByte[y]) ; // EEPROM position = meter number * 4 bytes } } void sendPowerUpdate(int meterNo) // Sends update to controller for current meter { gw.send(powerMsg.setSensor(meterNo).set((long)pulseMeters[meterNo].PowerW)); // meterNo * 100 )); gw.send(usageMsg.setSensor(meterNo).set((float)pulseMeters[meterNo].UsageWh/1000L ,3)); // send in kWh! } int storeMeterJSON(char *json) /* convert JSON to values and store in corresponding meter (if used) input: JSON string (can be wrong formatted), with length output: changed meter record number or -1 if error use JsonParser */ { StaticJsonBuffer<50> jsonBuffer; // 4 object -> 4 + 4*10 = 44 // char njson[] = "{\"m\":1,\"c\":12,\"r\":120000,\"cA\":12345}"; JsonObject& root = jsonBuffer.parseObject(json); if (!root.success()) { Serial.println(F("JsonParser.parse() failed")); errCount++ ; return -1; } int m = (long)root["m"]; if (m > NO_METERS){ // meter value out of range for used meters (m starts at 1) return -1 ; } else { // update meter values, Power is momentary, Usage is cumulative long newAccumWh = (long)root["cA"] ; long newWh = (long)root["c"] ; long diffAccumWh = newAccumWh - pulseMeters[m-1].UsageAccumWh; // check for missed pulses by comparing cA with last stored value if (diffAccumWh >= newWh){ // no difference or missed pulses -> correct: add difference pulseMeters[m-1].UsageWh += diffAccumWh; pulseMeters[m-1].DayUsageWh += diffAccumWh; } else { // negative diff, out of sync -> add pulses only (can be out of range or restart) pulseMeters[m-1].UsageWh += newWh; pulseMeters[m-1].DayUsageWh += newWh; } pulseMeters[m-1].UsageAccumWh = newAccumWh; // always update sync counter (only for sync and error correction(serial)) if ((long)root["r"] == 0){ // calculate power from pulse rate (ms) and truncate to whole Watts pulseMeters[m-1].PowerW = 0; // if overflow assume no Usage } else if (pulseMeters[m-1].Type == meter800){ pulseMeters[m-1].PowerW = long( 3600000000L / (long)root["r"]*0.8); // rate in microseconds for 800 pulse/kWh } else if (pulseMeters[m-1].Type == meter1000){ pulseMeters[m-1].PowerW = long( 3600000000L / (long)root["r"]); // rate in microseconds for 1000 pulse/kWh } else if (pulseMeters[m-1].Type == meter2000){ pulseMeters[m-1].PowerW = long( 3600000000L / (long)root["r"]/2); // rate in microseconds for 2000 pulse/kWh } else { Serial.println("geht nicht"); } return m ; } } int readLineJSON(int readch, char *buffer, int len) /* checks for JSON and when started append char tot buffer and checks for line completion usage: static char buffer[80]; if (readline(Serial.read(), buffer, 80) > 0) { // line complete} returns simple JSON */ { static int pos = 0; int rpos; if (readch > 0) { switch (readch) { case '\n': // Ignore new-lines break; case '\r': // Return on CR rpos = pos; pos = 0; // Reset position index ready for next time return rpos; default: if (pos < len-1) { buffer[pos++] = readch; buffer[pos] = 0; } } } // No end of line has been found, so return -1. return -1; } /* int dummySerial() // Acts as a dummy JSON serial character generator for debugging // input: none // output: preset JSON string { static int pos = 0; char json[] = "{\"m\":1,\"c\":12,\"r\":120000,\"cA\":12345}\r{\"m\":2,\"c\":212,\"r\":2120000,\"cA\":212345}\r{\"m\":3,\"c\":212,\"r\":2120000,\"cA\":212345}\n\r"; if (pos++ >= strlen(json)){ pos = 0; } return json[pos] ; } */ /* void printPulsemeter(int meter) // prints the Pulsemeter record to serial out { Serial.print("m:"); Serial.print(meter); Serial.print("type:"); Serial.print(pulseMeters[meter].Type); Serial.print(", power: "); Serial.print(pulseMeters[meter].PowerW); Serial.print(", usage: "); Serial.print(pulseMeters[meter].UsageWh); Serial.print(", day usage: "); Serial.println(pulseMeters[meter].DayUsageWh ); // Serial.print(", Ca: "); // Serial.println(pulseMeters[meter].UsageAccumWh); } */ -
Good evening,
After a couple of weeks, again i'm busy with my arduino's, but now i have a rasberry with domoticz near my arduino, so i don't need to send it wireless.
Is there a possibility to connect the master or slave arduino directly to my rasberry and read out the pulse meters??? -
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.
-
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
-
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
-
@FotoFieber To be honest .. a left over from some experiments. Just leave it out... you won't notice the difference.
-
@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...
-
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.001Is 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?? -
@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.
-
@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.
-
@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?
@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:
And a other one:
All the meters are showing also strange values on the axis.
Sorry for being such a noob at this.. :-S