Emoncms: data loggins halts on raspberry

 

I have a raspberry PI logging data from an emontx and a emonglcd
Recently (after 2-3 weeks of normal operation) data logging stopped for no apparent reason few times (now almost stops once a  day) and resumes if I restart the rfm12piphp service.
I updated emoncms and the database to the latest version but datalog keeps stopping randomly.

I only added few signals on emontx but I think it should not be a big problem (now I have 12 words being sent from emontx to raspberry)

I noticed the rfm12piphp.log file and I enabled the logging mode when restarting the service.
When I queried the service before restarting it it was "running"
I would like to know if there are more places to look to collect data useful to solve this problem

bye

TrystanLea's picture

Re: Emoncms: data loggins halts on raspberry

Hello Scarlaz, might be worth increasing the time between each time the rfm12pi sends time to the emonglcd, what do you have it set to at the moment? the sending of the time can cause the rfm12pi settings to get corrupted but its very infrequent.

Scarlaz's picture

Re: Emoncms: data loggins halts on raspberry

I got some lockup before upgrading to the latest version. At that time the raspberry was only receiving data from emontx and emonglcd (temperature).

I can increase the send time (was set to 55s). Now I set it to 50000 and we'll see.

Now logging is halted, emoncms shows "RFM12 to Pi interface script is up and running" log file show only TX operations and led on the rfm12pi does not blink when emontx sends data.
Recently I got also some issues with the telco company and internet connection at my place stopped few times. When this happened I saw that the emoncms (configured to forward data to emoncms.org) was unable to process input data. I believe it is went into timeout situations while trying to connect to the web.

Logging was unable to resume once web connection returned normal

I attached part of the log.

Thanks for  the outstanding contributions you are doing to this project!

Best Regards

mharizanov's picture

Re: Emoncms: data loggins halts on raspberry

Do you have v1 or v2 of the RFM2Pi ?

"led on the rfm12pi does not blink when emontx sends data." is a pointer, if you are running v1 you may want to 'lock' your settings

 

fammann's picture

Re: Emoncms: data loggins halts on raspberry

Hallo 

I seem to have the same problem. The configuration of the RFM12PI gets changed all the times (see log below). My setting on the Raspberry PI tab in emoncmspi is:

Freq 868MHz
Group 210
ID 16

but as you can see this changes all times. Once they are correct I can see information from node 10, 15 and 20.

What exactly do I need to change or update to get this issue resolved. Just got the kit which has the latest code installed!

Many thanks for your help

Fredi

DATA RX:  <n> b      - set MHz band (4 = 433, 8 = 868, 9 = 915)
DATA RX:  <nnn> g    - set network group (RFM12 only allows 212, 0 = any)
DATA RX:  <n> c      - set collect mode (advanced, normally 0)
DATA RX:  ...,<nn> a - send data packet to node <nn>, with ack
DATA RX:  ...,<nn> s - send data packet to node <nn>, no ack
DATA RX:  <n> l      - turn activity LED on DIG8 on or off
DATA RX:Current configuration:
DATA RX:80 i16 g16 @ 868 MHz  Lock: 1
DATA RX:
DATA RX:Available commands:
DATA RX:  123 x      - Toggle configuration change protection, 1=Unlocked
DATA RX:  <nn> i     - set node ID (standard node ids are 1..26)
DATA RX:  <n> b      - set MHz band (4 = 433, 8 = 868, 9 = 915)
DATA RX:  <nnn> g    - set network group (RFM12 only allows 212, 0 = any)
DATA RX:  <n> c      - set collect mode (advanced, normally 0)
DATA RX:  ...,<nn> a - send data packet to node <nn>, with ack
DATA RX:  ...,<nn> s - send data packet to node <nn>, no ack
DATA RX:  <n> l      - turn activity LED on DIG8 on or off
DATA RX:Current configuration:
DATA RX:80 i16 g16 @ 868 MHz  Lock: 1
DATA RX:
MESSAGE RX:> 0i
BASEID ERROR, RE SENDING BASEID
DATA RX:
CONFIG fail detected 1368178481
00,11,34,00s
MESSAGE RX:> 16i
BASEID SET CORRECTLY
DATA RX:
DATA RX:Available commands:
DATA RX:  123 x      - Toggle configuration change protection, 1=Unlocked
DATA RX:  <nn> i     - set node ID (standard node ids are 1..26)
DATA RX:  <n> b      - set MHz band (4 = 433, 8 = 868, 9 = 915)
DATA RX:  <nnn> g    - set network group (RFM12 only allows 212, 0 = any)
DATA RX:  <n> c      - set collect mode (advanced, normally 0)
DATA RX:  ...,<nn> a - send data packet to node <nn>, with ack
DATA RX:  ...,<nn> s - send data packet to node <nn>, no ack
DATA RX:  <n> l      - turn activity LED on DIG8 on or off
DATA RX:Current configuration:
DATA RX:80 i16 g104 @ 433 MHz  Lock: 1
DATA RX:
DATA RX:Available commands:
DATA RX:  123 x      - Toggle configuration change protection, 1=Unlocked
DATA RX:  <nn> i     - set node ID (standard node ids are 1..26)
DATA RX:  <n> b      - set MHz band (4 = 433, 8 = 868, 9 = 915)
DATA RX:  <nnn> g    - set network group (RFM12 only allows 212, 0 = any)
DATA RX:  <n> c      - set collect mode (advanced, normally 0)
DATA RX:  ...,<nn> a - send data packet to node <nn>, with ack
DATA RX:  ...,<nn> s - send data packet to node <nn>, no ack
DATA RX:  <n> l      - turn activity LED on DIG8 on or off
DATA RX:Current configuration:
DATA RX:80 i16 g104 @ 433 MHz  Lock: 1
DATA RX:
MESSAGE RX:> 0i
BASEID ERROR, RE SENDING BASEID
DATA RX:
CONFIG fail detected 1368178488
00,11,34,00s
MESSAGE RX:> 168b
FREQUENCY ERROR, RE SENDING FREQUENCY
DATA RX:
CONFIG fail detected 1368178493
MESSAGE RX:> 16i
BASEID SET CORRECTLY
DATA RX:
MESSAGE RX:> 8b
FREQUENCY SET CORRECTLY
DATA RX:
MESSAGE RX:> 210g
GROUP SET CORRECTLY
DATA RX:
00,11,34,00s
MESSAGE RX:> 11i
BASEID ERROR, RE SENDING BASEID
DATA RX:
MESSAGE RX:> 0b
FREQUENCY ERROR, RE SENDING FREQUENCY
DATA RX:
MESSAGE RX:> 168b
FREQUENCY ERROR, RE SENDING FREQUENCY
DATA RX:
MESSAGE RX:> 8b
FREQUENCY SET CORRECTLY
DATA RX:
DATA RX: 10 102 1 0 0 1 0 0 0
DATA RX: 15 10 0 35 0 1 0
DATA RX: 20 158 8
00,11,35,00s
DATA RX:Available commands:
DATA RX:  123 x      - Toggle configuration change protection, 1=Unlocked
DATA RX:  <nn> i     - set node ID (standard node ids are 1..26)
DATA RX:  <n> b      - set MHz band (4 = 433, 8 = 868, 9 = 915)
DATA RX:  <nnn> g    - set network group (RFM12 only allows 212, 0 = any)
DATA RX:  <n> c      - set collect mode (advanced, normally 0)
DATA RX:  ...,<nn> a - send data packet to node <nn>, with ack
DATA RX:  ...,<nn> s - send data packet to node <nn>, no ack
DATA RX:  <n> l      - turn activity LED on DIG8 on or off
DATA RX:Current configuration:
DATA RX:75 i11 g210 @ 868 MHz  Lock: 1
DATA RX:
DATA RX:Available commands:
DATA RX:  123 x      - Toggle configuration change protection, 1=Unlocked
DATA RX:  <nn> i     - set node ID (standard node ids are 1..26)
DATA RX:  <n> b      - set MHz band (4 = 433, 8 = 868, 9 = 915)
DATA RX:  <nnn> g    - set network group (RFM12 only allows 212, 0 = any)
DATA RX:  <n> c      - set collect mode (advanced, normally 0)
Sending remote dataDATA RX:  ...,<nn> a - send data packet to node <nn>, with ack
DATA RX:  ...,<nn> s - send data packet to node <nn>, no ack
DATA RX:  <n> l      - turn activity LED on DIG8 on or off
DATA RX:Current configuration:
DATA RX:75 i11 g210 @ 868 MHz  Lock: 1
DATA RX:
MESSAGE RX:> 0i
BASEID ERROR, RE SENDING BASEID
DATA RX:
CONFIG fail detected 1368178506
00,11,35,00s
DATA RX:Available commands:
DATA RX:  123 x      - Toggle configuration change protection, 1=Unlocked
DATA RX:  <nn> i     - set node ID (standard node ids are 1..26)
DATA RX:  <n> b      - set MHz band (4 = 433, 8 = 868, 9 = 915)
DATA RX:  <nnn> g    - set network group (RFM12 only allows 212, 0 = any)
DATA RX:  <n> c      - set collect mode (advanced, normally 0)
DATA RX:  ...,<nn> a - send data packet to node <nn>, with ack
DATA RX:  ...,<nn> s - send data packet to node <nn>, no ack
DATA RX:  <n> l      - turn activity LED on DIG8 on or off
DATA RX:Current configuration:
DATA RX:64 i0 g210 @ 433 MHz  Lock: 1
DATA RX:
MESSAGE RX:> 118b
FREQUENCY ERROR, RE SENDING FREQUENCY
DATA RX:
CONFIG fail detected ѵ½¡178511
D±q½ÉµX:Ùê        ½±±
±±åÁJjRrrrbâr¹ùùjÑ     ½¹¥
DATA RX:½¹%áy¹½É½5)ÉɹѠ  CONFIG fail detected 1368178516
00,11,35,00s
MESSAGE RX:> 16i
BASEID SET CORRECTLY
DATA RX:
MESSAGE RX:> 8b
FREQUENCY SET CORRECTLY
DATA RX:
DATA RX:Available commands:
DATA RX:  123 x      - Toggle configuration change protection, 1=Unlocked
DATA RX:  <nn> i     - set node ID (standard node ids are 1..26)
DATA RX:  <n> b      - set MHz band (4 = 433, 8 = 868, 9 = 915)
DATA RX:  <nnn> g    - set network group (RFM12 only allows 212, 0 = any)
DATA RX:  <n> c      - set collect mode (advanced, normally 0)
DATA RX:  ...,<nn> a - send data packet to node <nn>, with ack
DATA RX:  ...,<nn> s - send data packet to node <nn>, no ack
DATA RX:  <n> l      - turn activity LED on DIG8 on or off
DATA RX:Current configuration:
DATA RX:80 i16 g210 @ 868 MHz  Lock: 1
DATA RX:
MESSAGE RX:> 0s
LENGTH: -> 3 b
DATA RX: 10 104 1 0 0 1 0 0 0
DATA RX: 15 10 0 35 0 21 0
DATA RX: 20 152 8
00,11,35,00s
MESSAGE RX:> 0b
FREQUENCY ERROR, RE SENDING FREQUENCY
DATA RX:
MESSAGE RX:> 0b
FREQUENCY ERROR, RE SENDING FREQUENCY
DATA RX:
MESSAGE RX:> 8b
FREQUENCY SET CORRECTLY
DATA RX:
MESSAGE RX:> 8b
FREQUENCY SET CORRECTLY
DATA RX:
DATA RX: 10 104 1 0 0 1 0 0 0
DATA RX: 15 10 0 35 0 32 0
DATA RX: 20 152 8
00,11,35,00s
MESSAGE RX:> 11i
BASEID ERROR, RE SENDING BASEID
DATA RX:
MESSAGE RX:> 0b
FREQUENCY ERROR, RE SENDING FREQUENCY
DATA RX:
MESSAGE RX:> 0s
LENGTH: -> 1 b
MESSAGE RX:> 18b
FREQUENCY ERROR, RE SENDING FREQUENCY
DATA RX:
MESSAGE RX:> 8b
FREQUENCY SET CORRECTLY
DATA RX:
Sending remote data00,11,35,00s
DATA RX:Available commands:
DATA RX:  123 x      - Toggle configuration change protection, 1=Unlocked
DATA RX:  <nn> i     - set node ID (standard node ids are 1..26)
DATA RX:  <n> b      - set MHz band (4 = 433, 8 = 868, 9 = 915)
DATA RX:  <nnn> g    - set network group (RFM12 only allows 212, 0 = any)
DATA RX:  <n> c      - set collect mode (advanced, normally 0)
DATA RX:  ...,<nn> a - send data packet to node <nn>, with ack
DATA RX:  ...,<nn> s - send data packet to node <nn>, no ack
DATA RX:  <n> l      - turn activity LED on DIG8 on or off
DATA RX:Current configuration:
DATA RX:75 i11 g210 @ 868 MHz  Lock: 1
DATA RX:
DATA RX:Available commands:
DATA RX:  123 x      - Toggle configuration change protection, 1=Unlocked
DATA RX:  <nn> i     - set node ID (standard node ids are 1..26)
DATA RX:  <n> b      - set MHz band (4 = 433, 8 = 868, 9 = 915)
DATA RX:  <nnn> g    - set network group (RFM12 only allows 212, 0 = any)
DATA RX:  <n> c      - set collect mode (advanced, normally 0)
DATA RX:  ...,<nn> a - send data packet to node <nn>, with ack
DATA RX:  ...,<nn> s - send data packet to node <nn>, no ack
DATA RX:  <n> l      - turn activity LED on DIG8 on or off
DATA RX:Current configuration:
DATA RX:75 i11 g210 @ 868 MHz  Lock: 1
DATA RX:
MESSAGE RX:> 0i
BASEID ERROR, RE SENDING BASEID
DATA RX:
CONFIG fail detected 1368178540
^C
pi@emoncmspi /var/log $   

 

mharizanov's picture

Re: Emoncms: data loggins halts on raspberry

If you have v1 of the RFM2Pi board, you need to lock the settings.

To do it may be a bit tricky since you need to gain access to the serial without the cron/daemon standing on the way. The Wiki has tips how to disable the cron so you can freely communicate with the RFM2Pi board with minicom. do the correct settings and toggle the lock. Basically the command '123x' will toggle the settings lock. With the settings lock, the board will ignore any requests for change in band, id, group and you will use it happily ever after :)

There is some gibberish in the log you provided, this is typical for the v1 that was running software serial. V2 boards use hardware serial and don't have such issues.

fammann's picture

Re: Emoncms: data loggins halts on raspberry

Hallo Martin

 

thanks a lot. Now I know what the 123x actually stand for ;-)

Too bad that I got an older model as I just bought it.

Will try to make the change

Many thanks

Fredi

Scarlaz's picture

Re: Emoncms: data loggins halts on raspberry

Hi 

Since I have assembled the RFM12Pi by myself I guess I have the V1 version.... 

If I am right it seems I need to shutdown emoncms/cron and issue some commands to the card manually.
Could you point out some doc about this?

thanks

scarlaz

mharizanov's picture

Re: Emoncms: data loggins halts on raspberry

It depends on which version of emoncms you are running, the older one used cron; to disable it:

Open crontab: $ sudo nano /etc/crontab
Add a '#' in front of the line: */1 * * * * root cd /var/www/emoncms/Modules/raspberrypi && php raspberrypi_run.php
Reboot the pi with $ sudo reboot

for newer emoncms (v5) it is running as a daemon so you need to 

sudo service rfm12piphp stop (when done use sudo service rfm12piphp start)

So given that you have done the above successfully, emoncms is not going to touch the RFM2Pi board and we can talk to it over minicom.

 

start minicom:

minicom -b 9600 -o -D /dev/ttyAMA0

The default RFM12B settings are 868Mhz and network group 210

Type 4b into the minicom serial window to change the RFM12B to 433Mhz and 210g to change network group. 15i will sed the RFM2Pi board node id.

Type 'h' to see the current config.

when happy with the configuration, type 123x to lock these settings. The lock status should read 0 (meaning settings are locked). You may run in a frustration later if you try to change the settings and forget that you locked them, always check the status line ;-)

To exit minicom [CTRL+ A] then [X] then [Enter]

 

 

so having done the configuration and settings lock, you may enable the cron or daemon depending on your emoncms.

Should be 'happily ever after' time from now on :)

 

 

 

 

 

Scarlaz's picture

Re: Emoncms: data loggins halts on raspberry

Thanks for the reply.

Using your instructions I managed to lock the configuration (My actual configuration is the default configuration: group210; node15;868Mhz).
I had to stop rfm12piphp  and rfm2pigateway  services.

Anyway I found a problem... it happened that both the service and cron were enabled.... :-(  

Now the line in cron is disabled as it should be (using the last version of emoncms)

I locked config using 123x and now I re-enabled sending emonglcd timestamp (set at 60s).

I will see the results
Thanks!
Scarlaz

 

Scarlaz's picture

Re: Emoncms: data loggins halts on raspberry

Arghhh.... 

logging stopped again. This time at least one improvement: led on RFM12 kept blinking when receiving data: this means parms locking did its job.
Symptoms.

Raspberry PI seemed  overloaded, responded to ping but emoncms login did not respond. Remote desktop did not respond, I was only able to login via putty  and queried rfm12pi service and it was running...  Data forwarding did not work neither...When I queried services status interface did not respong anymore and I was forced to power-cycle the device.

Now I slowed down again the emonglcd time update but it is hard for me to believe that it is the culprit for such behavior.

My raspberry is not used only to run emoncms. I added few utils (remote desktop, samba) and I would like to make few more tests before reinstalling form scratch...

Any idea?

Thanks

Scaarlaz

Scarlaz's picture

Re: Emoncms: data loggins halts on raspberry

Update:

Setting an update time for emoglcd will cause logging to stop sooner or later. Now, with  timestamp disabled, logging kept working for 10 days without problems.

When logging stopped last time (with timestamp update enabled) all was "fine":
- rfm12b led blinked on raspberry (data received)
- Raspberry was not overloaded
-SD access was fine 
- Web interface showed all was ok (service running)
-rfm12php service status was "running".
- .... but data was not updated anymore.

A reboot solved the situation. 
I will have to make some debug on the service when timestamp update is enabled.

 

Regards

Jérôme's picture

Re: Emoncms: data loggins halts on raspberry

It would be interesting to have a log of the failure. I can't think of anything specific, but while the locking avoids the garble screwing up the radio config, it does not prevent garbled messages from coming in and perhaps did the Pi receive a message that couldn't be handled by the .php script algorithm.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.