For completeness, I have a short (200 mm) length of ribbon cable with 6-pin header plug to header socket, which I always use on one end of the programmer to allow it to be not ‘fixed’ to whatever while I’m using it, and a USB extension lead on the other end.
OK, my use case is probably different to most because my almost exclusive use of all emon kit is either answering problems here or developing sketches.
Might be interesting to test it with the zero strapped to the case of the emonTX just to see if there is any issue with the wifi. Although fully understand the concept of having the zero fairly rigidly attached to the side of the TX
Good point, might be an idea then to have some indication (*) to show that some configurations can be DIYed at a lower cost.
Hmmm - not sure about this one. It should certainly be an option on the configuration drop down when you are ordering and something to indicate it might well be a useful option. The emotional difference between £7 uplift when you are ordering and maybe don’t yet realise you need it and the £3 difference when you do find you need it isn’t comparable for me. Folks might not even notice the £3 extra it has cost them when they find they do need one. But let’s leave that to Trystan and Glynn.
Now I have found this thread (no idea why I would not remember it), I’m reviving it as I wonder if you did any more on this @Robert.Wall, @pb66?
I think it is a great idea and definitely worth looking at again @TrystanLea.
I did nothing further because it would involve big changes/additions to emonHub, and life’s too short to learn everything about everything.
If you’re going to move the greater part of the processing into the Pi, then it’s definitely worth, not pursuing, but looking at again in a fresh light with a view to doing the minimum - really only the data collection - inside the emonTx.
I’m still not sure how that will run with still handling serial data from the RFM, but it’s got to be worth a look.
An embarrassingly long time ago I managed to get three RaspberryPiZero’s c/w emonTx boards to send data to my emonPi via wi-fi, but for some reason I could never get the fourth one to work for more than a day or two.
In case it was something to do with my wiring on the pins on the Zero, I have just set it up on a RaspberryPi 4 c/w emonTx board instead - using ethernet for now. I have only connected one CT lead, and the cable it is wrapped around is not powered up at the moment, so I would expect a zero or thereabouts value.
Within emonHub of the new Pi in the Barn, I hashed out all of the RFM2Pi
section, and within the SerialTx section I gave it a nodename = Serial_PiZero_topbarn
- which is what I called it last time. I didn’t turn the emonTx’s RF off as I didn’t get involved with the Arduino side of things, although I suppose it may have remembered that from last time?
Looking at my Inputs page on my emonPi, the node Serial_PiZero_barn is not updating, but a new node of rx is; what might the cause of this be?
Sorry if I am being dim (again), but it has been so long since I did all of this that I have forgotten some of the details …
TIA
Dim? You’ve posted on an 11 months old thread, I can’t remember 11 days later
I’m rather lost about what you’re doing. Remember, you know your setup, all we know is what you describe.
Have you connected an emonTx to your Pi Zero W, hard-wired using serial, then you’re sending that by Wi-Fi to the RPi4 running emonCMS, which is also feeding into your LAN on wired Ethernet? What IP address and APIKey did you give it in its emonhub.conf?
If you have never turned it off, it’s on. If you turned it off “last time”, it should still be off unless you didn’t save the setting, in which case it will have reverted to the saved setting, or defaulted to on.
Are we looking at emonCMS NOT on the RPi4 you mentioned earlier?
Your emonPi is obviously receiving something from somewhere. If it’s in emonHub, it didn’t come via the LAN, and as it’s not wired, it must be by radio.
Thanks @Robert.Wall .
Instead of connecting a PiZero to an emonTx using 5 jumper wires & then communicating to my emonPi running emonCMS via wifi, for this Barn I have connected a RPi4 to the emonTx using 5 jumper wires, and then connect to the emonPi / emonCMS via ethernet. NB: I use a local emonCMS on my emonPi, not the “hosted” emoncms.org. I am not quite sure how to answer the “serial” bit of your question, unless using the jumper wires means serial.
The emonPi is 192.168.2.50, and the Pi4(/emonTx) is 192.168.2.54; this is the first section of the RPi4/emonTx’s Emonhub conf, which shows where I hashed out the RFM2Pi section, set a serialTx nodename and told it where my MQTT broker(?) is - NB: I use my emonPi for MQTT brokering.
#######################################################################
####################### emonhub.conf #########################
#######################################################################
### emonHub configuration file, for info see documentation:
### https://github.com/openenergymonitor/emonhub/blob/emon-pi/configuration.md
#######################################################################
####################### emonHub settings #######################
#######################################################################
[hub]
### loglevel must be one of DEBUG, INFO, WARNING, ERROR, and CRITICAL
loglevel = DEBUG
### Uncomment this to also send to syslog
# use_syslog = yes
#######################################################################
####################### Interfacers #######################
#######################################################################
[interfacers]
### This interfacer manages the RFM12Pi/RFM69Pi/emonPi module
#[[RFM2Pi]]
# Type = EmonHubJeeInterfacer
# [[[init_settings]]]
# com_port = /dev/ttyAMA0
# com_baud = 38400 # 9600 for old RFM12Pi
# [[[runtimesettings]]]
# pubchannels = ToEmonCMS,
# subchannels = ToRFM12,
#
# group = 210
# frequency = 433
# baseid = 5 # emonPi / emonBase nodeID
# calibration = 230V # (UK/EU: 230V, US: 110V)
# quiet = true # Disable quite mode (default enabled) to enable RF packet debugging, show packets which fail crc
# # interval = 300 # Interval to transmit time to emonGLCD (seconds)
[[SerialTx]]
Type = EmonHubTx3eInterfacer
[[[init_settings]]]
com_port= /dev/ttyAMA0
com_baud = 115200
[[[runtimesettings]]]
pubchannels = ToEmonCMS,
nodeoffset = 0
nodename = Serial_PiZero_topbarn
[[MQTT]]
Type = EmonHubMqttInterfacer
[[[init_settings]]]
mqtt_host = 192.168.2.50
mqtt_port = 1883
mqtt_user = emonpi
mqtt_passwd = emonpimqtt2016
[[[runtimesettings]]]
subchannels = ToEmonCMS,
timestamped = True
node_format_enable = 1
node_format_basetopic = emon/
[[emoncmsorg]]
Type = EmonHubEmoncmsHTTPInterfacer
[[[init_settings]]]
[[[runtimesettings]]]
pubchannels = ToRFM12,
subchannels = ToEmonCMS,
url = https://emoncms.org
apikey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
senddata = 1 # Enable sending data to Emoncms.org
sendstatus = 1 # Enable sending WAN IP to Emoncms.org MyIP > https://emoncms.org/myip/list
sendinterval= 30 # Bulk send interval to Emoncms.org in seconds
#######################################################################
####################### Nodes #######################
#######################################################################
[nodes]<<SNIP>>
I don’t think I inserted my local emonCMS’s write API key anywhere with this RPi4 / emonTx.
I am 99% sure I did turn the TX’s RF off last time - and would have saved it, so I will assume for now that it is off.
The screen grabs in my earlier post are what shows within emonCMS on my emonPi, yes. If I look at the emonCMS Inputs on the RPi4 / emonTx, ALL are n/a NULL
. This is a snippet of the emonHub log on the RPi4 / emonTx…
2021-02-16 18:28:47,948 DEBUG SerialTx 1096 Timestamp : 1613500127.947417
2021-02-16 18:28:47,948 DEBUG SerialTx 1096 From Node : Serial_PiZero_topbarn
2021-02-16 18:28:47,949 DEBUG SerialTx 1096 Values : [1098, 0, 0, 0, 0, 0, 0, 11]
2021-02-16 18:28:47,949 DEBUG SerialTx 1096 Sent to channel(start)' : ToEmonCMS
2021-02-16 18:28:47,949 DEBUG SerialTx 1096 Sent to channel(end)' : ToEmonCMS
2021-02-16 18:28:48,144 INFO MQTT Publishing 'node' formatted msg
2021-02-16 18:28:48,144 DEBUG MQTT Publishing: emon/rx/Serial_PiZero_topbarn/values 1098,0,0,0,0,0,0,11
2021-02-16 18:28:56,797 DEBUG SerialTx 1097 NEW FRAME : MSG:1099,Vrms:0.00,P1:0,E1:0,T1:0.00,T2:0.00,T3:0.00,pulse:11
2021-02-16 18:28:56,798 DEBUG SerialTx 1097 Timestamp : 1613500136.797482
2021-02-16 18:28:56,798 DEBUG SerialTx 1097 From Node : Serial_PiZero_topbarn
2021-02-16 18:28:56,799 DEBUG SerialTx 1097 Values : [1099, 0, 0, 0, 0, 0, 0, 11]
2021-02-16 18:28:56,799 DEBUG SerialTx 1097 Sent to channel(start)' : ToEmonCMS
2021-02-16 18:28:56,799 DEBUG SerialTx 1097 Sent to channel(end)' : ToEmonCMS
2021-02-16 18:28:56,983 INFO MQTT Publishing 'node' formatted msg
2021-02-16 18:28:56,983 DEBUG MQTT Publishing: emon/rx/Serial_PiZero_topbarn/values 1099,0,0,0,0,0,0,11
From the log…
Which is why you see what you do.
I was going to say you are using the wrong format node_format_enable
because the topic it is published on says emon/rx
, but you haven’t. I wonder if the Timestamped option is causing the issues.
timestamped
doesn’t work for that format (I think) so try taking it out.
Alternatively, use the JSON format.
# Single JSON payload published - use with Emoncms MQTT
node_JSON_enable = 1
node_JSON_basetopic = emon/
Many thanks @borpin - that has worked perfectly, and the data is coming through to emonCMS on my emonPi.
# timestamped = True
# node_format_enable = 1
# node_format_basetopic = emon/
node_JSON_enable = 1
node_JSON_basetopic = emon/
I had looked for where the node name rx
was being created but couldn’t find it.
Next step will be to try to add thew wps_supplicant file to the microSD card, and swap out the Pi4 for a PiZero.
EDITED TO ADD: Well that went well - all now sorted. Phew! Thanks for everyone’s help - hugely appreciated.
Using the JSON format, you can timestamp if required.
i’m trying to connect a Pi Zero W (via Ethernet to http://emonpi using a USB to Ethernet adapter) to an emonTx via serial. I can’t get any connection on the local network to emonpi. Am I missing something? I am using the emonSD image that was working on my emonbase, which I have edited to disable wifi.
I currently have a usb to Ethernet adapter connected to the Pi Zero W, which is in turn connected to an Ethernet to usb adapter going into my laptop.
At the base level, does the device appear on your network? Try the IP address rather then the mDNS that can be unreliable.
[edit]
No that won’t work for any device. Plug it into your router.
Thanks @borpin i’ll try that when i get home this evening.
Another solution might have been to use a RPI B+ rather than a Zero W as that has inbuilt Ethernet (but no wifi) and several full size USB ports, they are super cheap, not quite as cheap as a Zero W, but possibly more suited to the application at hand. (Plus double the memory IIRC).