datagateway stops sending data to emoncms.org in 24h

Hi guy's

I don't know what it is but i am using the ready to go pi image of the data gateway.

I configured the config and put my api key in to the config. I see on the site that feed data is receiving.

But the next the day feed data is stopped. and i have to reset my pi again to get it to emoncms.org

Can you help me to solve this issue ?

 

Thanx

Dennis

 

 

Id Name Tag Datatype Engine Public Size Updated Value      
14366 NET IO F1 kwhd   DAILY MYSQL   6.6kb 103 mins ago 2.36      
14369 Verb Tot F123 kwhd   DAILY MYSQL   6.6kb 103 mins ago 5.35      
14375 Outp PV   REALTIME PHPTIMESERIES   22Mb 103 mins ago 8.00      
14373 NET IO F2   REALTIME PHPTIMESERIES   22Mb 3 mins ago 431      
14376 Outp PV kwhd   DAILY MYSQL   6.6kb 103 mins ago 0.37      
14365 NET IO F1   REALTIME PHPTIMESERIES   22Mb 103 mins ago 185      
14374 NET IO F3   REALTIME PHPTIMESERIES   22Mb 3 mins ago 1973      
14370 Tot - PV   REALTIME PHPTIMESERIES   22Mb 103 mins ago 384      
14367 Verb F1   REALTIME PHPTIMESERIES   22Mb 103 mins ago 193      
14368 Verb Tot F123   REALTIME PHPTIMESERIES   22Mb 103 mins ago 392      
14371 Tot - PV kwhd   DAILY MYSQL   6.6kb 103 mins ago 4.97      
14491 Outp PV histogram   HISTOGRAM MYSQL   116kb 103 mins ago 0.00      

 

fabiusmontana's picture

Re: datagateway stops sending data to emoncms.org in 24h

Hello

Read this, from October 30 onwards.

 

RFM12Pi sometimes stops receiving

 

OK, it seems stuck while sending to your server.

Can you please try to add a timeout to urllib2.urlopen() ?

In oemgatewaybuffer.py, replace

result = urllib2.urlopen(url_string)

with

result = urllib2.urlopen(url_string, timeout=60)

and see if this still occurs.

Jérôme's picture

Re: datagateway stops sending data to emoncms.org in 24h

fabiusmontana's picture

Re: datagateway stops sending data to emoncms.org in 24h

Hello Jerome.

I modified the sketch as you suggested, and now the gateway works well, without any delays.
I brought the sleep of my two emontx to 10 seconds:

emontx_sleep (10);

I also set a threshold for the detection of flashes, because the Italian electricity meter has 2 LEDs, the second shows the reactive power, which I false counts.
Also introduced a threshold for minimum power, which eliminates the problem of false indications at night, because remained the last reading before turning off the inverter.

 

// The interrupt routine - runs each time a falling edge of a pulse is detected
void onPulse()
{
lastTime = pulseTime;        //used to measure time between pulses.
pulseTime = micros();

if ((pulseTime - lastTime)>100000000)      //threshold for minimum power
{
emontx.power = 0;
}

else if ((pulseTime - lastTime)>410000)     //minimum threshold between 2 flashes(8.5Kwp = 0.42 second between 2 flashes)
{
pulseCount++;                                                      //pulseCounter              
emontx.power = int((3600000000.0 / (pulseTime - lastTime))/ppwh);  //Calculate power
}

}

natnek's picture

Re: datagateway stops sending data to emoncms.org in 24h

fabiusmontana

" In oemgatewaybuffer.py, replace

result = urllib2.urlopen(url_string)

with

result = urllib2.urlopen(url_string, timeout=60)

 

OK I set the parameter i will look tomorrow

 

 

Thanx

Dennis

 

 

natnek's picture

Re: datagateway stops sending data to emoncms.org in 24h

Well I set the parameter but no result.

still no data towards emoncms.org  afther a view hours

rgds

Dennis

 

 

Jérôme's picture

Re: datagateway stops sending data to emoncms.org in 24h

natnek, please have a look at the logs.

See troubleshooting section, here: http://emoncms.org/site/docs/raspberrypigateway

 

natnek's picture

Re: datagateway stops sending data to emoncms.org in 24h

hope this will help

 

 

root@oemgateway:~# python /root/oem_gateway/oemgateway.py --config-file /boot/oemgateway.conf
2013-11-07 18:15:33,717 INFO Logging level set to DEBUG
2013-11-07 18:15:33,720 INFO Opening gateway...
2013-11-07 18:15:33,724 INFO Creating buffer emoncms_local
2013-11-07 18:15:33,728 INFO Creating buffer emoncms_remote
2013-11-07 18:15:33,732 INFO Creating listener RFM2Pi
2013-11-07 18:15:33,735 DEBUG Opening serial port: /dev/ttyAMA0
2013-11-07 18:15:33,740 INFO Setting send time interval to 300
2013-11-07 18:15:33,743 INFO Setting RFM2Pi | frequency: 8
2013-11-07 18:15:34,747 INFO Setting RFM2Pi | sgroup: 210
2013-11-07 18:15:35,751 INFO Setting RFM2Pi | baseid: 15
2013-11-07 18:15:36,755 INFO Creating listener Socket
2013-11-07 18:15:36,759 DEBUG Opening socket on port 50011
2013-11-07 18:15:36,782 DEBUG Broadcasting time: 18:15
2013-11-07 18:15:36,786 INFO Serial RX: > 8b
2013-11-07 18:15:36,992 INFO Serial RX: > 210g
2013-11-07 18:15:37,196 INFO Serial RX: > 15i
2013-11-07 18:15:37,401 INFO Serial RX: > 0s
2013-11-07 18:15:37,607 INFO Serial RX:  -> 4 b
2013-11-07 18:15:37,834 INFO Serial RX:  11 152 0 12 0 22 0 128 92
2013-11-07 18:15:37,837 DEBUG Node: 11
2013-11-07 18:15:37,840 DEBUG Values: [152, 12, 22, 23680]
2013-11-07 18:15:37,843 DEBUG Server emoncms.org -> send data: [11, 152, 12, 22, 23680]
2013-11-07 18:15:37,846 DEBUG Data string: &node=11&json={1:152,2:12,3:22,4:23680}
2013-11-07 18:15:37,849 DEBUG URL string: http://emoncms.org/input/post.json?apikey= my api key                                                  &node=11&json={1:152,2:12,3:22,4:23680}
2013-11-07 18:15:37,852 INFO Sending to emoncms.org
2013-11-07 18:15:39,098 DEBUG Send ok
2013-11-07 18:15:39,325 INFO Serial RX:  10 3 0 227 1 230 7 250 12
2013-11-07 18:15:39,328 DEBUG Node: 10
2013-11-07 18:15:39,331 DEBUG Values: [3, 483, 2022, 3322]
2013-11-07 18:15:39,334 DEBUG Server emoncms.org -> send data: [10, 3, 483, 2022, 3322]
2013-11-07 18:15:39,337 DEBUG Data string: &node=10&json={1:3,2:483,3:2022,4:3322}
2013-11-07 18:15:39,340 DEBUG URL string: http://emoncms.org/input/post.json?apikey=my api                                                                                 &node=10&json={1:3,2:483,3:2022,4:3322}
2013-11-07 18:15:39,343 INFO Sending to emoncms.org
2013-11-07 18:15:39,509 DEBUG Send ok
2013-11-07 18:15:42,786 INFO Serial RX:  11 145 0 6 0 11 0 178 92

Jérôme's picture

Re: datagateway stops sending data to emoncms.org in 24h

OK this is the beginning. Seems to work just fine.

The end would be interesting as it would show what happens when the gateway stops sending.

natnek's picture

Re: datagateway stops sending data to emoncms.org in 24h

Ok I might have found the problem.

I have connected two emon tx's straight to my 5v usb on my pi, after a serval hours the rfm12 stops receiving signals from my emon tx's

I think that my power supply of the raspberry is faulty,  possibly power from my supply is lowering after a while.

I have change my old power supply with a one.

I will look tomorrow if it is still working.

rgds

Dennis

 

natnek's picture

Re: datagateway stops sending data to emoncms.org in 24h

It is not the power supply.

I will let the debug session run untill it stops.

 

natnek's picture

Re: datagateway stops sending data to emoncms.org in 24h

 @ Jérôme

Ok I have somthing

 

 

 

2013-11-09 12:58:24,937 INFO Sending to emoncms.org
2013-11-09 12:58:26,071 DEBUG Send ok
2013-11-09 12:58:28,546 DEBUG Broadcasting time: 12:58
2013-11-09 12:58:28,755 INFO Serial RX:  10 2 0 99 0 73 0 250 12
2013-11-09 12:58:28,758 DEBUG Node: 10
2013-11-09 12:58:28,761 DEBUG Values: [2, 99, 73, 3322]
2013-11-09 12:58:28,764 DEBUG Server emoncms.org -> send data: [10, 2, 99, 73, 3322]
2013-11-09 12:58:28,767 DEBUG Data string: &node=10&json={1:2,2:99,3:73,4:3322}
2013-11-09 12:58:28,770 DEBUG URL string: http://emoncms.org/input/post.json?apikey=my api               &node=10&json={1:2,2:99,3:73,4:3322}
2013-11-09 12:58:28,773 INFO Sending to emoncms.org
2013-11-09 12:58:28,915 DEBUG Send ok
2013-11-09 12:58:29,120 INFO Serial RX: > 0b
2013-11-09 12:58:29,325 INFO Serial RX: > 0b
2013-11-09 12:58:29,549 INFO Serial RX: > 0b
2013-11-09 12:58:29,754 INFO Serial RX: > 0b
2013-11-09 13:03:28,750 DEBUG Broadcasting time: 13:3
2013-11-09 13:03:28,955 INFO Serial RX: > 0s
2013-11-09 13:03:29,160 INFO Serial RX:  -> 4 b
2013-11-09 13:08:28,907 DEBUG Broadcasting time: 13:8
2013-11-09 13:08:29,112 INFO Serial RX: > 0s
2013-11-09 13:08:29,317 INFO Serial RX:  -> 4 b
2013-11-09 13:13:29,052 DEBUG Broadcasting time: 13:13
2013-11-09 13:13:29,257 INFO Serial RX: > 0s
2013-11-09 13:13:29,463 INFO Serial RX:  -> 4 b
2013-11-09 13:18:29,089 DEBUG Broadcasting time: 13:18
2013-11-09 13:18:29,316 INFO Serial RX: > 0s
2013-11-09 13:18:29,522 INFO Serial RX:  -> 4 b
2013-11-09 13:23:29,290 DEBUG Broadcasting time: 13:23

Jérôme's picture

Re: datagateway stops sending data to emoncms.org in 24h

OK. You are most likely facing a bug affecting rev1 of the RFM2Pi board: sending through the serial port garbles the reception.

Try to disable the emonGLCD time sending feature.

Long term solutions:

- disable the feature

- increase time sending period and pray

- use RFM2Pi rev2 (SMT model)

I don't have time right now but you should find info in the forum or the doc.

natnek's picture

Re: datagateway stops sending data to emoncms.org in 24h

Ok

Can someone explain in simple steps to disable the time feature ?

 

thanx

Jérôme's picture

Re: datagateway stops sending data to emoncms.org in 24h

Well if you're using the OEM Gateway, you should have configured it in the config file (parameter sendtimeinterval):

https://github.com/Jerome-github/oem_gateway/blob/master/oemgateway.conf...

Default value is 0 which means "never".

 

natnek's picture

Re: datagateway stops sending data to emoncms.org in 24h

Ok Jérôme

I have set the parameter to 0  mine was 300

I hope this will work. I will report tomorrow

thanx for your time

 

natnek's picture

Re: datagateway stops sending data to emoncms.org in 24h

Jérôme

Problem solved.

Setting the time parameter to 0 did the trick

You told that the Default value is 0 which means "never".

It is not the default value on the two raspberry pi images on the site
The default value in those images is 300

So for RFM12 v1 owners must set this parameter to 0 (mabe a little note on the start page will be helpful)

rgds

natnek

Jérôme's picture

Re: datagateway stops sending data to emoncms.org in 24h

OK, I wrote this here. Thanks for the feedback.

Comment viewing options

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