Hi
Just had a chance to look at this again this evening and still having no success. As I have no solar PV, just a single CT for a 1phase supply, I just want to be able to display that for now on the GLCD.
The Pi is “emonSD-07Nov16” but on EmonCMS low-write 9.9.5.
I have updated the emonglcd-send.cfg as follows:
#mqtt params
mqtt_hostname: 127.0.0.1:1883
mqtt_user: emonpi
mqtt_pass: emonpimqtt2016
#mqtt topics for publishing
mqtt_pub_topic: emonhub/tx
#mqtt topics for subscribing to
#mqtt_sub_solarW:emon/emonpi/power2
#mqtt_sub_solarKwh:emon/samilpower/ETODAY
mqtt_sub_utilityW:emon/emonpi/power1corrected
mqtt_sub_utilityKwh:emon/emonpi/use_kwh
#CSV list of RF IDs of emonglcd displays
emonglcd_nodeid:20
My emonhub.conf file has:
[[20]]
nodename = emonglcd
firmware =V1_1
hardware = emonglcd
[[[rx]]]
names = temperature,
datacodes = h
scales = 0.01,1
units = c
[[[tx]]]
names =nodeid,hour,minute,second,utilityW,solarW,utilityKwh,solarKwh
datacodes =b,b,b,h,h,H,H
units = h,min,sec,W,W,kwh,kwh
The interval = line has been commented out now.
Within NodeRed, I have used the supplied file from here: EmonGLCD/emonglcd_updater_nodered.json at master · openenergymonitor/EmonGLCD · GitHub
Corrected the “Utility kW” input to emon/emonpi/power1corrected and “Utility kwh” input to emon/emonpi/use_kwh. Username & password set correctly and looking at “localhost:1883” as a server. When deployed, there is no output to the debug
As a test, I have set up an “Inject” input of an empty string, injecting every 10 seconds into a “function http request” that fetches every 10 seconds from “http://127.0.0.1/emoncms/feed/value.json&apikey=my read only key&id=22” then it fetches the emon/emonpi/power1corrected feed values correctly. I have done the same thing for emon/emonpi/use_kwh which is “http://127.0.0.1/emoncms/feed/value.json&apikey=my read only key&id=8”.
It’s hacky, but it seems the only way I can fetch these two feeds. An example of the output of these two HTTP fetches are: 559.545 for emon/emonpi/power1corrected and 6387.7614416546 for emon/emonpi/use_kwh. These are fed into the “convert to watts & store” and “convert to int & store” functions already provided.
When these two are fed into the provided NodeRed sketch, I get an output on the debug line as: 23,24,23,750075,0,638764.02981548,0 and an error from EmonHub as:
2019-01-17 23:24:19,120 DEBUG MQTT Publishing: emon/emonpi/power1 685
2019-01-17 23:24:19,122 DEBUG MQTT Publishing: emon/emonpi/power2 0
2019-01-17 23:24:19,123 DEBUG MQTT Publishing: emon/emonpi/power1pluspower2 685
2019-01-17 23:24:19,125 DEBUG MQTT Publishing: emon/emonpi/vrms 231.71
2019-01-17 23:24:19,126 DEBUG MQTT Publishing: emon/emonpi/t1 18.1
2019-01-17 23:24:19,128 DEBUG MQTT Publishing: emon/emonpi/t2 18.5
2019-01-17 23:24:19,129 DEBUG MQTT Publishing: emon/emonpi/t3 0
2019-01-17 23:24:19,130 DEBUG MQTT Publishing: emon/emonpi/t4 0
2019-01-17 23:24:19,131 DEBUG MQTT Publishing: emon/emonpi/t5 0
2019-01-17 23:24:19,134 DEBUG MQTT Publishing: emon/emonpi/t6 0
2019-01-17 23:24:19,137 DEBUG MQTT Publishing: emon/emonpi/pulsecount 55369
2019-01-17 23:24:19,140 INFO MQTT Publishing: emonhub/rx/5/values 685,0,685,231.71,18.1,18.5,0,0,0,0,55369
2019-01-17 23:24:19,142 DEBUG RFM2Pi Discarding RX frame 'unreliable content'? 0 0 0 0 0 0 0 32 0 0 32 0 16 0 0 32 0 0 32 0 32 (-108)
2019-01-17 23:24:21,756 DEBUG RFM2Pi Discarding RX frame 'unreliable content'? 0 32 32 0 0 0 0 32 0 0 32 0 16 0 0 32 0 0 32 0 32 (-106)
2019-01-17 23:24:22,464 DEBUG RFM2Pi Discarding RX frame 'unreliable content'? 0 32 0 0 0 0 0 0 32 0 32 32 0 0 32 32 32 0 32 32 0 (-109)
2019-01-17 23:24:23,359 DEBUG MQTT Nodeid: 20 values: 23,24,23,750075,0,638764.02981548,0
2019-01-17 23:24:23,360 DEBUG MQTT 105160 Sent to channel' : ToRFM12
2019-01-17 23:24:23,482 WARNING RFM2Pi Exception caught in RFM2Pi thread. Traceback (most recent call last):
File "/home/pi/emonhub/src/emonhub_interfacer.py", line 40, in wrapper
return f(*args)
File "/home/pi/emonhub/src/emonhub_interfacer.py", line 123, in run
self.add(frame)
File "/home/pi/emonhub/src/interfacers/EmonHubJeeInterfacer.py", line 81, in add
txc = self._process_tx(cargo)
File "/home/pi/emonhub/src/emonhub_interfacer.py", line 576, in _process_tx
for b in ehc.encode(dc,int(scaled[i])):
File "/home/pi/emonhub/src/emonhub_coder.py", line 46, in encode
result = struct.unpack(e + b*s, struct.pack(e + datacode, value))
error: short format requires SHRT_MIN <= number <= SHRT_MAX
2019-01-17 23:24:23,657 WARNING MainThread RFM2Pi thread is dead.
2019-01-17 23:24:23,659 WARNING MainThread Attempting to restart thread RFM2Pi (thread has been restarted 5 times...
2019-01-17 23:24:23,660 INFO MainThread Creating EmonHubJeeInterfacer 'RFM2Pi'
2019-01-17 23:24:23,662 DEBUG MainThread Opening serial port: /dev/ttyAMA0 @ 38400 bits/s
2019-01-17 23:24:25,674 INFO MainThread RFM2Pi device firmware version: [emonPi.29.00]
2019-01-17 23:24:25,674 INFO MainThread RFM2Pi device current settings: E i5 g210 @ 433 MHz q0 USA 0
2019-01-17 23:24:25,675 INFO MainThread Setting RFM2Pi calibration: 230V (1p)
2019-01-17 23:24:26,677 DEBUG MainThread Setting RFM2Pi subchannels: ['ToRFM12']
2019-01-17 23:24:26,678 DEBUG MainThread Setting RFM2Pi pubchannels: ['ToEmonCMS']
2019-01-17 23:24:26,682 DEBUG RFM2Pi device settings updated: E i5 g210 @ 433 MHz q0 USA 0
2019-01-17 23:24:26,787 DEBUG RFM2Pi Discarding RX frame 'unreliable content'? 0 0 0 0 0 0 0 0 32 0 32 32 0 0 32 32 32 0 32 32 0 (-107)
2019-01-17 23:24:27,419 DEBUG RFM2Pi Discarding RX frame 'unreliable content'? 0 0 32 32 0 0 0 0 32 16 128 0 32 0 0 32 0 4 32 0 0 (-109)
I’m still running the debug sketch on GLCD and node 5 never transmits. I make the assumption here that my use_kwh feed raw data number of 6387.7614416546 as an example is still causing the transmission to fail due to the sheer number of decimal points so I try another test.
I have fashioned a corrected packet without the decimal points 23,42,45,750075,0,638764,0 that is sent into the msg.payload part of the NodeRed example. This too manages to trigger a crash of Emonhub:
2019-01-17 23:43:00,460 DEBUG MQTT Nodeid: 20 values: 23,42,45,750075,0,638764,0
2019-01-17 23:43:00,461 DEBUG MQTT 105471 Sent to channel' : ToRFM12
2019-01-17 23:43:00,651 DEBUG RFM2Pi Discarding RX frame 'unreliable content'? 0 0 32 33 128 52 225 0 2 0 0 0 0 114 5 32 32 0 35 128 0 (-109)
2019-01-17 23:43:00,653 WARNING RFM2Pi Exception caught in RFM2Pi thread. Traceback (most recent call last):
File "/home/pi/emonhub/src/emonhub_interfacer.py", line 40, in wrapper
return f(*args)
File "/home/pi/emonhub/src/emonhub_interfacer.py", line 123, in run
self.add(frame)
File "/home/pi/emonhub/src/interfacers/EmonHubJeeInterfacer.py", line 81, in add
txc = self._process_tx(cargo)
File "/home/pi/emonhub/src/emonhub_interfacer.py", line 576, in _process_tx
for b in ehc.encode(dc,int(scaled[i])):
File "/home/pi/emonhub/src/emonhub_coder.py", line 46, in encode
result = struct.unpack(e + b*s, struct.pack(e + datacode, value))
error: short format requires SHRT_MIN <= number <= SHRT_MAX
2019-01-17 23:43:00,846 WARNING MainThread RFM2Pi thread is dead.
2019-01-17 23:43:00,847 WARNING MainThread Attempting to restart thread RFM2Pi (thread has been restarted 19 times...
2019-01-17 23:43:00,849 INFO MainThread Creating EmonHubJeeInterfacer 'RFM2Pi'
2019-01-17 23:43:00,851 DEBUG MainThread Opening serial port: /dev/ttyAMA0 @ 38400 bits/s
2019-01-17 23:43:02,857 INFO MainThread RFM2Pi device firmware version & configuration: not available
2019-01-17 23:43:02,858 INFO MainThread Setting RFM2Pi frequency: 433 (4b)
2019-01-17 23:43:03,540 DEBUG emoncmsorg Buffer size: 9
2019-01-17 23:43:03,860 INFO MainThread Setting RFM2Pi group: 210 (210g)
2019-01-17 23:43:04,862 INFO MainThread Setting RFM2Pi quiet: 0 (0q)
2019-01-17 23:43:05,864 INFO MainThread Setting RFM2Pi baseid: 5 (5i)
2019-01-17 23:43:06,866 INFO MainThread Setting RFM2Pi calibration: 230V (1p)
2019-01-17 23:43:07,868 DEBUG MainThread Setting RFM2Pi subchannels: ['ToRFM12']
2019-01-17 23:43:07,869 DEBUG MainThread Setting RFM2Pi pubchannels: ['ToEmonCMS']
2019-01-17 23:43:07,873 DEBUG RFM2Pi device settings updated: E i5 g210 @ 433 MHz q0 USA 0
At this point, I haven’t a clue what else to try and I am loathed to do a fresh install into the Pi, given that I’m on the current version of Emoncms.