My emonBase is not seeing my emonTx v3. The red LED blinks on the emonTx and the RF board on the emonBase's red LED is blinking at the same time.
This system just arrived, and is my first. The emonBase came with a pre-programmed SSD card. Both units were ordered with 433MHz RF. The Temonx is powered by an AC adapter. There are no sensors (other than the AC adapter) plugged into the emonTx.
I have verified (with a spectrum analyzer) that the emonTx is periodically sending a burst on about 433.96 MHz (because it's a short duration signal, I don't have a precise frequency).
THe RF board on the Base is identified as a 433 MHz RFM69CW by the picture and the missing capacitor.
Here are the contents of /var/log/emonhub/emonhub.log showing all messages since the last boot.
The config file has not been touched. I did verify that logging is in DEBUG mode.
Here are a couple of logs, and the Nodes page from the web server is attached as an image.
Note that I rebooted emonBase at 03:00:11 UTC.
emonhub.log
2015-06-17 14:40:33,801 INFO MainThread EmonHub Pre-Release Development Version (rc2.0?)
2015-06-17 14:40:33,802 INFO MainThread Opening hub...
2015-06-17 14:40:33,803 INFO MainThread Logging level set to DEBUG
2015-06-17 14:40:33,804 INFO MainThread Creating EmonHubJeeInterfacer 'RFM2Pi'
2015-06-17 14:40:33,807 DEBUG MainThread Opening serial port: /dev/ttyAMA0 @ 38400 bits/s
2015-06-17 14:40:35,813 WARNING MainThread Device communication error - check settings
2015-06-17 14:40:35,814 INFO MainThread Setting RFM2Pi frequency: 433 (4b)
2015-06-17 14:40:36,816 INFO MainThread Setting RFM2Pi group: 210 (210g)
2015-06-17 14:40:37,819 INFO MainThread Setting RFM2Pi quiet: 0 (0q)
2015-06-17 14:40:38,821 INFO MainThread Setting RFM2Pi baseid: 5 (5i)
2015-08-03 03:00:11,107 INFO MainThread Setting RFM2Pi calibration: 230V (1p)
2015-08-03 03:00:12,110 DEBUG MainThread Setting RFM2Pi subchannels: ['ToRFM12']
2015-08-03 03:00:12,111 DEBUG MainThread Interfacer: Subscribed to channel' : ToRFM12
2015-08-03 03:00:12,111 DEBUG MainThread Setting RFM2Pi pubchannels: ['ToEmonCMS']
2015-08-03 03:00:12,112 DEBUG MainThread Interfacer: Subscribed to channel' : ToRFM12
2015-08-03 03:00:12,116 INFO MainThread Creating EmonHubMqttInterfacer 'MQTT'
2015-08-03 03:00:12,117 INFO MainThread MQTT Init mqtt_host=127.0.0.1 mqtt_port=1883
2015-08-03 03:00:12,121 DEBUG MainThread MQTT Subscribed to channel' : ToEmonCMS
2015-08-03 03:00:12,126 INFO MainThread Creating EmonHubEmoncmsHTTPInterfacer 'emoncmsorg'
2015-08-03 03:00:12,127 DEBUG MainThread emoncmsorg Subscribed to channel' : ToEmonCMS
2015-08-03 03:00:12,223 INFO MQTT Connecting to MQTT Server
2015-08-03 03:00:12,228 INFO MQTT connection status: Connection successful
2015-08-03 03:00:12,229 DEBUG MQTT CONACK => Return code: 0
2015-08-03 03:00:12,331 INFO MQTT on_subscribe
emoncms.log
2015-8-3 03:00:10 FEEDWRITER INFO Starting feedwriter process
2015-8-3 03:00:10 MQTT INFO Starting emoncms mqtt nodes process
2015-8-3 03:00:10 FEEDWRITER INFO PHPTimeSeries bytes written: 0
2015-8-3 03:00:10 FEEDWRITER INFO PHPFina bytes written: 0
2015-8-3 03:00:10 MQTT INFO subscribing to emonhub/rx/#
2015-8-3 03:00:16 MQTT INFO Reloading config
2015-8-3 03:00:22 MQTT INFO Reloading config
2015-8-3 03:00:28 MQTT INFO Reloading config
2015-8-3 03:00:34 MQTT INFO Reloading config
2015-8-3 03:00:40 MQTT INFO Reloading config
2015-8-3 03:00:46 MQTT INFO Reloading config
2015-8-3 03:00:52 MQTT INFO Reloading config
2015-8-3 03:00:58 MQTT INFO Reloading config
2015-8-3 03:01:04 MQTT INFO Reloading config
2015-8-3 03:01:10 MQTT INFO Reloading config
2015-8-3 03:01:10 FEEDWRITER INFO PHPTimeSeries bytes written: 0
2015-8-3 03:01:10 FEEDWRITER INFO PHPFina bytes written: 0
2015-8-3 03:01:16 MQTT INFO Reloading config
2015-8-3 03:01:22 MQTT INFO Reloading config
2015-8-3 03:01:28 MQTT INFO Reloading config
2015-8-3 03:01:34 MQTT INFO Reloading config
2015-8-3 03:01:40 MQTT INFO Reloading config
2015-8-3 03:01:46 MQTT INFO Reloading config
2015-8-3 03:01:52 MQTT INFO Reloading config
2015-8-3 03:01:58 MQTT INFO Reloading config
2015-8-3 03:02:04 MQTT INFO Reloading config
2015-8-3 03:02:10 MQTT INFO Reloading config...etc...
Re: Newbie needq help - New system: emonBase not seeing emonTx
The auto-baud detection is not present in the "emon-pi" emonSD card image and is pre-configured for the emonPi baud, you should also try setting the baud to either 9600 or 57600 in emonhub.conf
Paul
Re: Newbie needq help - New system: emonBase not seeing emonTx
Paul,
Thanks. Based on your input, I changed the only baud rate I saw in the config file to 57600, but still no joy. I also tried 9600.
I am including the log file contents and the configuration file below. Did I change the right thing?
----- Log File -----
2015-08-03 17:51:29,258 INFO MainThread Deleting interfacer 'RFM2Pi'
2015-08-03 17:51:29,259 INFO MainThread Creating EmonHubJeeInterfacer 'RFM2Pi'
2015-08-03 17:51:29,260 DEBUG MainThread Opening serial port: /dev/ttyAMA0 @ 57600 bits/s
2015-08-03 17:51:31,269 WARNING MainThread Device communication error - check settings
2015-08-03 17:51:31,270 INFO MainThread Setting RFM2Pi frequency: 433 (4b)
2015-08-03 17:51:32,271 INFO MainThread Setting RFM2Pi group: 210 (210g)
2015-08-03 17:51:33,273 INFO MainThread Setting RFM2Pi quiet: 0 (0q)
2015-08-03 17:51:34,275 INFO MainThread Setting RFM2Pi baseid: 5 (5i)
2015-08-03 17:51:35,277 INFO MainThread Setting RFM2Pi calibration: 230V (1p)
2015-08-03 17:51:36,279 DEBUG MainThread Setting RFM2Pi subchannels: ['ToRFM12']
2015-08-03 17:51:36,280 DEBUG MainThread Interfacer: Subscribed to channel' : ToRFM12
2015-08-03 17:51:36,280 DEBUG MainThread Setting RFM2Pi pubchannels: ['ToEmonCMS']
2015-08-03 17:51:36,281 DEBUG MainThread Interfacer: Subscribed to channel' : ToRFM12
2015-08-03 17:51:36,282 DEBUG MainThread MQTT Subscribed to channel' : ToEmonCMS
2015-08-03 17:51:36,283 DEBUG MainThread emoncmsorg Subscribed to channel' : ToEmonCMS
----- emonhub.conf ----
### This interfacer manages the RFM2Pi module
[[RFM2Pi]]
Type = EmonHubJeeInterfacer
[[[init_settings]]]
com_port = /dev/ttyAMA0
com_baud = 57600
[[[runtimesettings]]]
pubchannels = ToEmonCMS,
subchannels = ToRFM12,
# datacode = B #(default:h)
# scale = 100 #(default:1)
group = 210 #(default:210)
frequency = 433 #(default:433)
baseid = 5 #(emonPi default:5)
quiet = false #(default:true)
calibration = 230V #(UK/EU: 230V, US: 110V)
# interval = 300 #(default:0)
# nodeoffset = 32 #(default:0)
### This interfacer manages the RFM2Pi module
[[MQTT]]
Type = EmonHubMqttInterfacer
[[[init_settings]]]
mqtt_host = 127.0.0.1
mqtt_port = 1883
[[[runtimesettings]]]
pubchannels = ToRFM12,
subchannels = ToEmonCMS,
basetopic = emonhub/
[[emoncmsorg]]
Type = EmonHubEmoncmsHTTPInterfacer
[[[init_settings]]]
[[[runtimesettings]]]
pubchannels = ToRFM12,
subchannels = ToEmonCMS,
url = http://emoncms.org
apikey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
senddata = 1
sendstatus = 1
#######################################################################
####################### Nodes #######################
#######################################################################
[nodes]
### List of nodes by node ID
### 'datacode' is default for node and 'datacodes' are per value data codes.
### if both are present 'datacode' is ignored in favour of 'datacodes'
### eg node 99 would expect 1 long and 4 ints, unless the "datacodes" line
### was removed, then "datacode" would make it expect any number of longs,
### likewise per value "scales" will override default node "scale", the number
### of "scales" must match the number of values or frame will be discarded.
[[5]]
nodename = emonPi
firmware = emonPi_RFM69CW_RF12Demo_DiscreteSampling.ino
hardware = emonpi
[[[rx]]]
names = power1,power2,power1_plus_power2,Vrms,T1,T2,T3,T4,T5,T6,pulseCount
datacodes = h, h, h, h, h, h, h, h, h, h, L
scales = 1,1,1,0.01,0.1,0.1,0.1,0.1,0.1,0.1,1
units = W,W,W,V,C,C,C,C,C,C,p
[[19]]
nodename = emonTH_1
firmware = emonTH_DHT22_DS18B20.ino
hardware = emonTH_(Node_ID_Switch_DIP1:OFF_DIP2:OFF)
[[[rx]]]
names = temperature, external temperature, humidity, battery
datacode = h
scales = 0.1,0.1,0.1,0.1
units = C,C,%,V
[[20]]
nodename = emonTH_2
firmware = emonTH_DHT22_DS18B20.ino
hardware = emonTH_(Node_ID_Switch_DIP1:ON_DIP2:OFF)
[[[rx]]]
names = temperature, external temperature, humidity, battery
datacode = h
scales = 0.1,0.1,0.1,0.1
units = C,C,%,V
[[21]]
nodename = emonTH_3
firmware = emonTH_DHT22_DS18B20.ino
hardware = emonTH_(Node_ID_Switch_DIP1:OFF_DIP2:ON)
[[[rx]]]
names = temperature, external temperature, humidity, battery
datacode = h
scales = 0.1,0.1,0.1,0.1
units = C,C,%,V
[[22]]
nodename = emonTH_4
firmware = V1_5_emonTH_DHT22_DS18B20.ino
hardware = emonTH_(Node_ID_Switch_DIP1:ON_DIP2:ON)
[[[rx]]]
names = temperature, external temperature, humidity, battery
datacode = h
scales = 0.1,0.1,0.1,0.1
units = C,C,%,V
[[10]]
nodename = emonTx_1
firmware =V1_6_emonTxV3_4_DiscreteSampling
hardware = emonTx_(NodeID_DIP_Switch1:OFF)
[[[rx]]]
names = power1, power2, power3, power4, Vrms, temp1, temp2, temp3, temp4, temp5, temp6, pulse #Firmware V1.6
#names = power1, power2, power3, power4, Vrms, temp #Firmware =<V1.4 (un-comment)
datacode = h
scales = 1,1,1,1,0.01,0.1,0.1, 0.1,0.1,0.1,0.1,1 #Firmware V1.6
units =W,W,W,W,V,C,C,C,C,C,C,p #FirmwareV1.6
#scales = 1,1,1,1,0.01,0.1 #Firmware =<V1.4 (un-comment)
#units =W,W,W,W,V,C #Firmware =<V1.4 (un-comment)
[[9]]
nodename = emonTx_2
firmware =V1_6_emonTxV3_4_DiscreteSampling
hardware = emonTx_(NodeID_DIP_Switch1:ON)
[[[rx]]]
names = power1, power2, power3, power4, Vrms, temp1, temp2, temp3, temp4, temp5, temp6, pulse #Firmware V1.6
#names = power1, power2, power3, power4, Vrms, temp #Firmware =<V1.4 (un-comment)
datacode = h
scales = 1,1,1,1,0.01,0.1,0.1, 0.1,0.1,0.1,0.1,1 #Firmware V1.6
units =W,W,W,W,V,C,C,C,C,C,C,p #FirmwareV1.6
#scales = 1,1,1,1,0.01,0.1 #Firmware =<V1.4 (un-comment)
#units =W,W,W,W,V,C #Firmware =<V1.4 (un-comment)
Re: Newbie needq help - New system: emonBase not seeing emonTx
2015-08-03 17:51:29,260 DEBUG MainThread Opening serial port: /dev/ttyAMA0 @ 57600 bits/s
2015-08-03 17:51:31,269 WARNING MainThread Device communication error - check settings
This error suggests a comms issue between the Pi and the RFM2Pi, baud was the obvious choice as it pops up frequently. is the board located on the Pi's gpio correctly? Does the little SMT LED illuminate at any time?
The RFM2Pi only really needs power to work, if the emontx is sending then the led should acknowledge reciept on the RFM2Pi.
If you are using a pre-configured SDcard you should'nt need to worry about the serial console, but it is worth checking the last line of /etc/inittab is commented out and "tty" is only mentioned once in the /boot/cmdline.txt.
If you have purchased the kit recently then the baud will "probably" be 38400, you could try using minicom to establish a comms link and confirm the baud.
Paul
Re: Newbie needq help - New system: emonBase not seeing emonTx
Paul, Thanks...
When I run minicom, I get garbage characters. More arrive with each blink of emonTx.
I have tried 9600, 19200, 38400 and 57600 with the same results (although the number of garbage characters varies).
The minicom command is (for 9600): minicom -b9600 -D/dev/ttyAMA0
Is it possible that everything is working and I just don't know it? I rely on the "Nodes" tab on the web page and it is saying all nodes are inactive. I have no sensors hooked up to the emonTx, but it does have an AC power supply, which should show up as ID 4, I think.
Re: Newbie needq help - New system: emonBase not seeing emonTx
"Is it possible that everything is working and I just don't know it?"
When using loglevel = DEBUG in emonHub the log will show each packets journey in and out of emonHub so the initial connection error log seems to be valid if you have a functioning device sending data and the RFM2Pi is flashing reciept.
"When I run minicom, I get garbage characters. More arrive with each blink of emonTx." it may be that as emonHub has already taken ownership of the serial port (albeit at the wrong baud perhaps) that minicom can only piggy-back whats there and not set the baud it wants. Try stopping emonhub using sudo service emonhub stop and try minicom again, if you are not getting legible numbers in minicom emonhub will not be able to do anything with the "garbage" either. Once you have determined the baud and seen valid numbers, exit minicom set the baud in emonhub.conf and restart with sudo service emonhub start and see where that gets us.
Paul
Re: Newbie needq help - New system: emonBase not seeing emonTx
Thanks.
The log is showing no packets.
I followed your advice and stopped emonhub service. That did not lead to a change - minicom still gets only garbage - which comes in at the time the emonTx transmits and some other times. I am including the log below in case it helps. The best clue seems to to be the communications error.
I put my storage scope on the output pin from the receiver (RasPi connector pin 9). It looks like it is getting valid characters (for 1 stop-bit signaling), although I don't know what they should be. I decoded a sequence manually that started out:20 3F 20 31 37 30 20 31 37 31 20....The bit rate on that pin looks slightly off - I am estimating about 41kbps, based on the scope's measurement. I don't know if that is within the tolerance for the UART on the Pi or not.
I am also seeing data (on the scope) when the emonTx is not transmitting... just random bursts from time to time. There are other devices transmitting on this frequency - I can hear them on my service monitor, but the data bursts on the RFM2PI pin do not seem to be correlated well with them.
I'm pretty baffled.
Below is the log showing the service shutting down and coming back up:
2015-08-05 02:43:52,521 DEBUG MainThread SIGINT received.
2015-08-05 02:43:52,522 INFO MainThread Exiting hub...
2015-08-05 02:43:52,679 INFO MainThread Exit completed
2015-08-05 02:43:58,718 INFO MainThread EmonHub emonHub 'emon-pi' variant v1.0
2015-08-05 02:43:58,718 INFO MainThread Opening hub...
2015-08-05 02:43:58,719 INFO MainThread Logging level set to DEBUG
2015-08-05 02:43:58,720 INFO MainThread Creating EmonHubJeeInterfacer 'RFM2Pi'
2015-08-05 02:43:58,721 DEBUG MainThread Opening serial port: /dev/ttyAMA0 @ 38400 bits/s
2015-08-05 02:44:00,726 WARNING MainThread Device communication error - check settings
2015-08-05 02:44:00,727 INFO MainThread Setting RFM2Pi frequency: 433 (4b)
2015-08-05 02:44:01,729 INFO MainThread Setting RFM2Pi group: 210 (210g)
2015-08-05 02:44:02,731 INFO MainThread Setting RFM2Pi quiet: 0 (0q)
2015-08-05 02:44:03,733 INFO MainThread Setting RFM2Pi baseid: 5 (5i)
2015-08-05 02:44:04,736 INFO MainThread Setting RFM2Pi calibration: 230V (1p)
2015-08-05 02:44:05,738 DEBUG MainThread Setting RFM2Pi subchannels: ['ToRFM12']
2015-08-05 02:44:05,740 DEBUG MainThread Interfacer: Subscribed to channel' : ToRFM12
2015-08-05 02:44:05,741 DEBUG MainThread Setting RFM2Pi pubchannels: ['ToEmonCMS']
2015-08-05 02:44:05,742 DEBUG MainThread Interfacer: Subscribed to channel' : ToRFM12
2015-08-05 02:44:05,744 INFO MainThread Creating EmonHubMqttInterfacer 'MQTT'
2015-08-05 02:44:05,747 INFO MainThread MQTT Init mqtt_host=127.0.0.1 mqtt_port=1883
2015-08-05 02:44:05,755 DEBUG MainThread MQTT Subscribed to channel' : ToEmonCMS
2015-08-05 02:44:05,763 INFO MainThread Creating EmonHubEmoncmsHTTPInterfacer 'emoncmsorg'
2015-08-05 02:44:05,765 DEBUG MainThread emoncmsorg Subscribed to channel' : ToEmonCMS
2015-08-05 02:44:05,863 INFO MQTT Connecting to MQTT Server
2015-08-05 02:44:05,867 INFO MQTT connection status: Connection successful
2015-08-05 02:44:05,868 DEBUG MQTT CONACK => Return code: 0 2015-08-05 02:44:05,971 INFO MQTT on_subscribe
Re: Newbie needq help - New system: emonBase not seeing emonTx
I'm a little baffled too at this point. The decoded sequence reads " ? 170 171 " when converted (hex to ascii) which could be a good sign as any received packets considered invalid are prefixed with space q'mark space, so a morsal of hope?
At this stage we are unsure of which party is at fault but I'm inclined to suspect the rfm2pi rather than the Pi, but if you wish to check the Pi further you could use 2 link wires to connect the serial rx and gnd of the Pi to your emonTx to read the debug serial output normally seen via the IDE and usb programmer.
I would probally try using avrdude to "read" the rfm2pi fuses (the values will not actually be shown due to the lock) the bootloader baud is independent of the sketches baud,
avrdude -v -c arduino -p ATMEGA328P -P /dev/ttyAMA0 -b 38400
If you can get a valid response from the rfm2pi to this command and not an error it will prove the Pi UART is OK and the AVR bootloader is good you can then just try uploading a new FW hex to the rfm2pi via avrdude and you should be good, fingers crossed.
Leave emonhub stopped for now, until you can use minicom to read the rfm2pi stream.
Paul
Re: Newbie needq help - New system: emonBase not seeing emonTx
Update: I purchased a new rfm2pi and installed it. Things are now working.