Jump to content

Polyglot weather station node servers


bpwwer

Recommended Posts

  • 2 weeks later...

@bpwwer, can you provide additional guidance to what the configuration key and value combinations are required in the Configuration screen when using with Meteobridge? The help screen seems to describe what goes in the key field, but I have no idea how to populate the value field. Pretty cool nodeserver.

Thanks.

Link to comment
Share on other sites

13 hours ago, MTB said:

@bpwwer, can you provide additional guidance to what the configuration key and value combinations are required in the Configuration screen when using with Meteobridge? The help screen seems to describe what goes in the key field, but I have no idea how to populate the value field. Pretty cool nodeserver.

Thanks.

First, which node server are you using?  I have two that support data from the MeteoBridge. There is one in the node server store called MeteoBridge and that shouldn't need much configuration; IPAddress, Port, and Units, the port should default to 5557 which is the port that MeteoBridge allows connections on to get XML formatted data.

But it sounds like you're trying the WeatherPoly node server that's still being developed. For that, the configuration is a bit more involved. When you set up MeteoBridge to send it's data to the node server, it sends a list of of space separated values. The configuration is used to map those values (by position) to a node value.  The key is the ISY node '-' value combination to store the data in.  The value is a number representing the position in the list of values sent by the MeteoBridge.  Now the problem, I haven't found a reference for what the MeteoBridge is sending, some of the values were obvious, but others are not.  I've been focused on getting this working with Cumulus and was mainly using MeteoBridge to get the basics working since I don't have a station supported by Cumulus.

What I need is a good reference for what the MeteoBridge is sending or set it up to work with a different weather service. 

After a bit more investigation, it may make more sense to use the HTTP Event push in MeteoBridge.  It looks like that could be configured to send a request almost identical to what Cumulus is sending. The HTTP URL would look something like http://<ip address>:port/cumulus?wind=[wind0wind-act.1]&temp=[th0temp-act.1]  Then the mapping would use the strings defined in the URL to map each value to a node, just like with Cumulus.

Another option would be to use the MeteoTemplate weather network option, but I would need to find a reference for that to know what format it's sending the data in.

 

Link to comment
Share on other sites

10 hours ago, bpwwer said:

First, which node server are you using?  I have two that support data from the MeteoBridge. There is one in the node server store called MeteoBridge and that shouldn't need much configuration; IPAddress, Port, and Units, the port should default to 5557 which is the port that MeteoBridge allows connections on to get XML formatted data.

What I need is a good reference for what the MeteoBridge is sending or set it up to work with a different weather service. 

 

You are correct, I am using the WeatherPoly. I tried the MeteoBridge sever first, but ran into some issue and saw WeatherPoly and thought I'd give that a go. I'll circle back and try the MeteoBridge server again.

I think the following is the output format for the MeteoBridge Home Weatherstation Template:

%s/mb.php?d=[DD]/[MM]/[YYYY] [hh]:[mm]:[ss] [th0temp-act:--] [th0hum-act:--] [th0dew-act:--] [wind0avgwind-act:--] [wind0wind-act:--] [wind0dir-act:--] [rain0rate-act:--] [rain0total-daysum:--] [thb0seapress-act:--] [wind0dir-act:--] [wind0wind-act=bft.0:--] m/s C hPa mm -- [thb0seapress-val60:--] [rain0total-monthsum:--] [rain0total-yearsum:--] [rain0total-ydaysum:--] [thb0temp-act:--] [thb0hum-act:--] [wind0chill-act:--] [th0temp-val60:--] [th0temp-dmax:--] [th0temp-dmaxtime:--] [th0temp-dmin:--] [th0temp-dmintime:--] [wind0avgwind-dmax:--] [wind0avgwind-dmaxtime:--] [wind0wind-dmax:--] [wind0wind-dmaxtime:--] [thb0seapress-dmax:--] [thb0seapress-dmaxtime:--] [thb0seapress-dmin:--] [thb0seapress-dmintime:--] [mbsystem-swversion:--] [mbsystem-buildnum:--] [wind0wind-max10:--] -- -- [uv0index-act:--] -- [sol0rad-act:--] [wind0dir-avg10:--] [rain0total-sum60:--] -- [mbsystem-daynightflag:--] -- [wind0dir-avg10:--] -- m -- [mbsystem-daylength:--] -- -- [uv0index-dmax:--] [th0hum-dmax:--] [th0hum-dmaxtime:--] [th0hum-dmin:--] [th0hum-dmintime:--] [th0dew-dmax:--] [th0dew-dmaxtime:--] [th0dew-dmin:--] [th0dew-dmintime:--] [th0temp-val15:—] [th0hum-val15:—] [th0dew-val15:—] [thb0temp-val15:—] [thb0hum-val15.0:--] [wind0wind-avg15:—] [wind0wind-avg30:—] [lgt0energy-act:--] [lgt0dist-act:--] [lgt0dist-age:--] [lgt0total-daysum.0:--] [lgt0total-monthsum.0:--] [lgt0total-yearsum.0:--] [sol0rad-dmax:--] [mbsystem-uptime:—-] [th0temp-ydmax:--] [th0temp-ydmaxtime:--] [th0temp-ydmin:--] [th0temp-ydmintime:--] [th0temp-mmax:--] [th0temp-mmaxtime:--] [th0temp-mmin:--] [th0temp-mmintime:--] [th0temp-ymax:--] [th0temp-ymaxtime:--] [th0temp-ymin:--] [th0temp-ymintime:--] [wind0wind-ydmax:--] [wind0wind-ydmaxtime:--] [wind0wind-mmax:--] [wind0wind-mmaxtime:--] [wind0wind-ymax:--] [wind0wind-ymaxtime:--] [rain0total-ydmax:--] [rain0total-mmax:--] [rain0total-mmaxtime:--] [rain0total-ymax:--] [rain0total-ymaxtime:--] [sol0rad-dmax:--] [sol0rad-dmaxtime:--] [sol0rad-ydmax:--] [sol0rad-ydmaxtime:--] [sol0rad-mmax:--] [sol0rad-mmaxtime:--] [sol0rad-ymax:--] [sol0rad-ymaxtime:—] [uv0index-dmaxtime:--] [uv0index-ydmax:--] [uv0index-ydmaxtime:--] [uv0index-mmax:--] [uv0index-mmaxtime:--] [uv0index-ymax:--] [uv0index-ymaxtime:—] [thb0temp-dmax:--] [thb0temp-dmin:--]

Once again, really cool stuff!

Edited by MTB
Fixed node name
Link to comment
Share on other sites

12 hours ago, MTB said:

I think the following is the output format for the MeteoBridge Home Weatherstation Template:


%s/mb.php?d=[DD]/[MM]/[YYYY] [hh]:[mm]:[ss] [th0temp-act:--] [th0hum-act:--] [th0dew-act:--] [wind0avgwind-act:--] [wind0wind-act:--] [wind0dir-act:--] [rain0rate-act:--] [rain0total-daysum:--] [thb0seapress-act:--] [wind0dir-act:--] [wind0wind-act=bft.0:--] m/s C hPa mm -- [thb0seapress-val60:--] [rain0total-monthsum:--] [rain0total-yearsum:--] [rain0total-ydaysum:--] [thb0temp-act:--] [thb0hum-act:--] [wind0chill-act:--] [th0temp-val60:--] [th0temp-dmax:--] [th0temp-dmaxtime:--] [th0temp-dmin:--] [th0temp-dmintime:--] [wind0avgwind-dmax:--] [wind0avgwind-dmaxtime:--] [wind0wind-dmax:--] [wind0wind-dmaxtime:--] [thb0seapress-dmax:--] [thb0seapress-dmaxtime:--] [thb0seapress-dmin:--] [thb0seapress-dmintime:--] [mbsystem-swversion:--] [mbsystem-buildnum:--] [wind0wind-max10:--] -- -- [uv0index-act:--] -- [sol0rad-act:--] [wind0dir-avg10:--] [rain0total-sum60:--] -- [mbsystem-daynightflag:--] -- [wind0dir-avg10:--] -- m -- [mbsystem-daylength:--] -- -- [uv0index-dmax:--] [th0hum-dmax:--] [th0hum-dmaxtime:--] [th0hum-dmin:--] [th0hum-dmintime:--] [th0dew-dmax:--] [th0dew-dmaxtime:--] [th0dew-dmin:--] [th0dew-dmintime:--] [th0temp-val15:—] [th0hum-val15:—] [th0dew-val15:—] [thb0temp-val15:—] [thb0hum-val15.0:--] [wind0wind-avg15:—] [wind0wind-avg30:—] [lgt0energy-act:--] [lgt0dist-act:--] [lgt0dist-age:--] [lgt0total-daysum.0:--] [lgt0total-monthsum.0:--] [lgt0total-yearsum.0:--] [sol0rad-dmax:--] [mbsystem-uptime:—-] [th0temp-ydmax:--] [th0temp-ydmaxtime:--] [th0temp-ydmin:--] [th0temp-ydmintime:--] [th0temp-mmax:--] [th0temp-mmaxtime:--] [th0temp-mmin:--] [th0temp-mmintime:--] [th0temp-ymax:--] [th0temp-ymaxtime:--] [th0temp-ymin:--] [th0temp-ymintime:--] [wind0wind-ydmax:--] [wind0wind-ydmaxtime:--] [wind0wind-mmax:--] [wind0wind-mmaxtime:--] [wind0wind-ymax:--] [wind0wind-ymaxtime:--] [rain0total-ydmax:--] [rain0total-mmax:--] [rain0total-mmaxtime:--] [rain0total-ymax:--] [rain0total-ymaxtime:--] [sol0rad-dmax:--] [sol0rad-dmaxtime:--] [sol0rad-ydmax:--] [sol0rad-ydmaxtime:--] [sol0rad-mmax:--] [sol0rad-mmaxtime:--] [sol0rad-ymax:--] [sol0rad-ymaxtime:—] [uv0index-dmaxtime:--] [uv0index-ydmax:--] [uv0index-ydmaxtime:--] [uv0index-mmax:--] [uv0index-mmaxtime:--] [uv0index-ymax:--] [uv0index-ymaxtime:—] [thb0temp-dmax:--] [thb0temp-dmin:--]

Once again, really cool stuff!

Thanks!  I'm curious where you found that as I did some searching and didn't see that.  

Now my challenge will be how to actually document this in the node server. The Polyglot configuration help doesn't seem like it would work well for multiple large tables that describe all of this.  So to configure, just set the configuration key to the values position starting from 0. The date would be 0, time would be 1, and temperature 2, humidity 3, etc.

 

12 hours ago, MTB said:

You are correct, I am using the WeatherPoly. I tried the MeteoBridge sever first, but ran into some issue and saw WeatherPoly and thought I'd give that a go. I'll circle back and try the MeteoBridge server again.

Let me know if you have any issues with the MeteoBridge poly. I've only tested with my specific set up so if something isn't working I'd like know.  It probably is a bit more limited than using the WeatherPoly node server as I think it just handles the primary sensor data.

Link to comment
Share on other sites

1 hour ago, bpwwer said:

Thanks!  I'm curious where you found that as I did some searching and didn't see that.  

I found it in the WXforum here https://www.wxforum.net/index.php?topic=31507.msg324631#msg324631, which provided this link: http://content.meteobridge.com/templates/homeweatherstation.template. I've been very impressed with Meteobridge - very solidly written and very flexible templating.

I have been having some issues with the MeteoBridge poly. I had to manually create the profile/nodedef directory after installation. Also, the data doesn't make it into the ISY correctly. The outdoor temp and dew point come in as 0C, but for some reason, the Windchill calculates correctly. Humidity is 0%. The Wind direction is correct, but I don't know about the wind speed (no wind right now). Here are some screenshots:

image.png.0ece843d8b3f17de77c5d4a55e95856c.png

image.png.e83df28b8c7df533bec344af5932d856.png

image.png.3c0bad0ca6c7c9263a99aa405d2dc72e.png

image.png.0017906458a26fb2bd5ff4f4699770d8.png

If I manually do an XML query to my Meteobridge it looks like this:

<logger>
<RAIN date="20181026164049" id="rain0" rate="0.0" total="0.0" delta="0.0" lowbat="0"/>
<THB date="20181026164049" id="thb0" temp="0.0" hum="0" dew="0.0" press="1019.8" seapress="1019.8" fc="-1" lowbat="0"/>
<TH date="20181026164030" id="th0" temp="21.2" hum="56" dew="12.9" lowbat="0"/>
<WIND date="20181026164049" id="wind0" dir="180" gust="0.0" wind="0.0" chill="21.2" lowbat="0"/>
</logger>

I have an Acurite 5n1 weatherstation. I suspect the issue is interpreting the "THB" vs "TH" records. One thing to keep in mind is that the zero at the end of the id's indicates the sensor. I had a second sensor, which reported as "th1" which I removed to eliminate that sensor as a source of confusion.

Here is a snippet from the log file for one reporting interval (60sec). It's curious that it seems to be reporting twice. I don't know if I somehow have two servers going in all my messing around to get it to work? The Polyglot server only shows one...

2018-10-26 09:46:45,308 [Controller] [DEBUG] b'<logger>\n  <RAIN date="20181026164545" id="rain0" rate="0.0" total="0.0" delta="0.0" lowbat="0" />\n  <THB date="20181026164640" id="thb0" temp="0.0" hum="0" dew="0.0" press="1019.8" seapress="1019.8" fc="-1" lowbat="0" />\n  <TH date="20181026164640" id="th0" temp="21.6" hum="56" dew="13.2" lowbat="0" />\n  <WIND date="20181026164640" id="wind0" dir="203" gust="0.0" wind="0.0" chill="21.6" lowbat="0" />\n</logger>\n'
2018-10-26 09:46:45,308 [Controller] [DEBUG] b'<logger>\n  <RAIN date="20181026164545" id="rain0" rate="0.0" total="0.0" delta="0.0" lowbat="0" />\n  <THB date="20181026164640" id="thb0" temp="0.0" hum="0" dew="0.0" press="1019.8" seapress="1019.8" fc="-1" lowbat="0" />\n  <TH date="20181026164640" id="th0" temp="21.6" hum="56" dew="13.2" lowbat="0" />\n  <WIND date="20181026164640" id="wind0" dir="203" gust="0.0" wind="0.0" chill="21.6" lowbat="0" />\n</logger>\n'
2018-10-26 09:46:45,309 [Controller] [DEBUG] tag = logger
2018-10-26 09:46:45,309 [Controller] [DEBUG] tag = logger
2018-10-26 09:46:45,311 [Controller] [DEBUG]    child = RAIN
2018-10-26 09:46:45,311 [Controller] [DEBUG]    child = RAIN
2018-10-26 09:46:45,312 [Controller] [DEBUG]     Rate    = 0.0
2018-10-26 09:46:45,312 [Controller] [DEBUG]     Rate    = 0.0
2018-10-26 09:46:45,312 [Controller] [DEBUG]     Delta   = 0.0
2018-10-26 09:46:45,312 [Controller] [DEBUG]     Delta   = 0.0
2018-10-26 09:46:45,313 [Controller] [DEBUG]     Total   = 0.0
2018-10-26 09:46:45,313 [Controller] [DEBUG]     Total   = 0.0
2018-10-26 09:46:45,315 [Controller] [INFO ] Updating Driver rain - ST: 0.0, uom: 24
2018-10-26 09:46:45,315 [Controller] [INFO ] Updating Driver rain - ST: 0.0, uom: 24
2018-10-26 09:46:45,318 [Controller] [INFO ] Updating Driver rain - GV7: 0.0, uom: 105
2018-10-26 09:46:45,318 [Controller] [INFO ] Updating Driver rain - GV7: 0.0, uom: 105
2018-10-26 09:46:45,321 [Controller] [DEBUG]    child = THB
2018-10-26 09:46:45,321 [Controller] [DEBUG]    child = THB
2018-10-26 09:46:45,324 [Controller] [INFO ] Updating Driver temperature - GV0: 32.0, uom: 17
2018-10-26 09:46:45,324 [Controller] [INFO ] Updating Driver temperature - GV0: 32.0, uom: 17
2018-10-26 09:46:45,329 [Controller] [INFO ] Updating Driver temperature - ST: 32.0, uom: 17
2018-10-26 09:46:45,329 [Controller] [INFO ] Updating Driver temperature - ST: 32.0, uom: 17
2018-10-26 09:46:45,333 [Controller] [INFO ] Updating Driver humidity - ST: 0.0, uom: 22
2018-10-26 09:46:45,333 [Controller] [INFO ] Updating Driver humidity - ST: 0.0, uom: 22
2018-10-26 09:46:45,336 [Controller] [INFO ] Updating Driver pressure - ST: 30.115, uom: 23
2018-10-26 09:46:45,336 [Controller] [INFO ] Updating Driver pressure - ST: 30.115, uom: 23
2018-10-26 09:46:45,340 [Controller] [INFO ] Updating Driver pressure - GV0: 30.115, uom: 23
2018-10-26 09:46:45,340 [Controller] [INFO ] Updating Driver pressure - GV0: 30.115, uom: 23
2018-10-26 09:46:45,343 [Controller] [DEBUG]     Dewpoin = 0.0
2018-10-26 09:46:45,343 [Controller] [DEBUG]     Dewpoin = 0.0
2018-10-26 09:46:45,344 [Controller] [DEBUG]     Humidit = 0
2018-10-26 09:46:45,344 [Controller] [DEBUG]     Humidit = 0
2018-10-26 09:46:45,345 [Controller] [DEBUG]     Temp    = 0.0
2018-10-26 09:46:45,345 [Controller] [DEBUG]     Temp    = 0.0
2018-10-26 09:46:45,346 [Controller] [DEBUG]     Sea     = 1019.8
2018-10-26 09:46:45,346 [Controller] [DEBUG]     Sea     = 1019.8
2018-10-26 09:46:45,347 [Controller] [DEBUG]     pressur = 1019.8
2018-10-26 09:46:45,347 [Controller] [DEBUG]     pressur = 1019.8
2018-10-26 09:46:45,349 [Controller] [DEBUG]    child = TH
2018-10-26 09:46:45,349 [Controller] [DEBUG]    child = TH
2018-10-26 09:46:45,350 [Controller] [DEBUG]     Dewpoin = 13.2
2018-10-26 09:46:45,350 [Controller] [DEBUG]     Dewpoin = 13.2
2018-10-26 09:46:45,352 [Controller] [DEBUG]     Humidit = 56
2018-10-26 09:46:45,352 [Controller] [DEBUG]     Humidit = 56
2018-10-26 09:46:45,353 [Controller] [DEBUG]     Temp    = 21.6
2018-10-26 09:46:45,353 [Controller] [DEBUG]     Temp    = 21.6
2018-10-26 09:46:45,354 [Controller] [DEBUG]    child = WIND
2018-10-26 09:46:45,354 [Controller] [DEBUG]    child = WIND
2018-10-26 09:46:45,356 [Controller] [INFO ] Updating Driver temperature - GV1: 70.9, uom: 17
2018-10-26 09:46:45,356 [Controller] [INFO ] Updating Driver temperature - GV1: 70.9, uom: 17
2018-10-26 09:46:45,360 [Controller] [INFO ] Updating Driver wind - ST: 0.0, uom: 48
2018-10-26 09:46:45,360 [Controller] [INFO ] Updating Driver wind - ST: 0.0, uom: 48
2018-10-26 09:46:45,363 [Controller] [INFO ] Updating Driver wind - GV1: 0.0, uom: 48
2018-10-26 09:46:45,363 [Controller] [INFO ] Updating Driver wind - GV1: 0.0, uom: 48
2018-10-26 09:46:45,367 [Controller] [INFO ] Updating Driver wind - GV0: 203.0, uom: 14
2018-10-26 09:46:45,367 [Controller] [INFO ] Updating Driver wind - GV0: 203.0, uom: 14
2018-10-26 09:46:45,370 [Controller] [DEBUG]     chill   = 21.6
2018-10-26 09:46:45,370 [Controller] [DEBUG]     chill   = 21.6
2018-10-26 09:46:45,371 [Controller] [DEBUG]     wind    = 0.0
2018-10-26 09:46:45,371 [Controller] [DEBUG]     wind    = 0.0
2018-10-26 09:46:45,373 [Controller] [DEBUG]     gust    = 0.0
2018-10-26 09:46:45,373 [Controller] [DEBUG]     gust    = 0.0
2018-10-26 09:46:45,375 [Controller] [DEBUG]     direct  = 203
2018-10-26 09:46:45,375 [Controller] [DEBUG]     direct  = 203

Thanks for the time you put in developing this.

Edited by MTB
Added note about installation issue.
Link to comment
Share on other sites

50 minutes ago, MTB said:

I have been having some issues with the MeteoBridge poly. I had to manually create the profile/nodedef directory after installation. Also, the data doesn't make it into the ISY correctly. The outdoor temp and dew point come in as 0C, but for some reason, the Windchill calculates correctly. Humidity is 0%. The Wind direction is correct, but I don't know about the wind speed (no wind right now). Here are some screenshots:

If I manually do an XML query to my Meteobridge it looks like this:


<logger>
<RAIN date="20181026164049" id="rain0" rate="0.0" total="0.0" delta="0.0" lowbat="0"/>
<THB date="20181026164049" id="thb0" temp="0.0" hum="0" dew="0.0" press="1019.8" seapress="1019.8" fc="-1" lowbat="0"/>
<TH date="20181026164030" id="th0" temp="21.2" hum="56" dew="12.9" lowbat="0"/>
<WIND date="20181026164049" id="wind0" dir="180" gust="0.0" wind="0.0" chill="21.2" lowbat="0"/>
</logger>

I have an Acurite 5n1 weatherstation. I suspect the issue is interpreting the "THB" vs "TH" records. One thing to keep in mind is that the zero at the end of the id's indicates the sensor. I had a second sensor, which reported as "th1" which I removed to eliminate that sensor as a source of confusion.

 

That's interesting, I'm ignoring the TH records and only using the THB record.  Mine is reporting the same data in both, but since THB includes the pressure data, that seemed like the one to use. It's easy enough for me to change it to use the temp/humidity from the TH record and only pressure from THB, it's just not clear to me why there's both and why I should choose to look at one over the other.

And, looking at the ID and ignoring the extra sensors is a good suggestion.  Again, since I don't have any, I didn't take that into account.

It does look like you might have two instances of the node server running. I've had some issues with that as well, stopping the node server doesn't seem to always work.  From the command line:

ps axuww | grep meteobridge

Will show how many are running.

Link to comment
Share on other sites

 

I noticed something on WeatherPoly that I hadn't previously reported, two entries for Battery showing up. Not sure where that's coming from. 

image.png.6f16ec39df84d1b4368814fb1a7a0735.png

Any more thoughts on how to handle the display units from Cumulus? 

Link to comment
Share on other sites

3 hours ago, DaveStLou said:
I noticed something on WeatherPoly that I hadn't previously reported, two entries for Battery showing up. Not sure where that's coming from. 

Any more thoughts on how to handle the display units from Cumulus? 

I left the battery entries there because it is possible to get battery status for some sensors, but I haven't hooked those entries up to anything.  Long term, they should be auto generated based on the configuration like the other entries.

I just uploaded a new version that has some high-level handling of units. You can configure the incoming and display units separately and it will do the proper conversions. But it is still just overall us, uk, metric.  I'd like to make this more granular at some point, but this should at least get it reporting correctly

 

1 hour ago, DaveStLou said:

Another observation this afternoon, temperatures node does not show up as an option for conditions or actions for my installation of WeatherPoly.

You're right. temperature and rain nodes aren't showing up.  That should be fixed in the latest version too.  However, I'm not sure if polyglot will update the node definition on update or not. To get things updated on the ISY I did the following:

  1. With the latest version running, select the WeatherPoly main node and press the update_profile button.
  2. Restart the admin console

 

Link to comment
Share on other sites

19 hours ago, bpwwer said:

Uploaded version 0.1.1 of the MeteoBridge node server. Restricts it to using sensor 0 values and uses TH instead of THB for temp/humidity values.

Nice. I now have both MeteoBridge and WeatherPoly nodeservers working with my Meteobridge device. Thanks!

Mark

Link to comment
Share on other sites

On 10/26/2018 at 4:56 PM, bpwwer said:

To get things updated on the ISY I did the following:

  1. With the latest version running, select the WeatherPoly main node and press the update_profile button.
  2. Restart the admin console

My update didn't go smoothly. I'm seeing this error in the WeatherPoly log:

2018-10-27 18:06:00,257 INFO     WeatherPoly Node Server Started.
2018-10-27 18:06:00,258 INFO     Configuration Change...
2018-10-27 18:06:00,258 INFO     Web server failed to start.
2018-10-27 18:06:00,270 ERROR    Exception in thread Thread-3:
Traceback (most recent call last):
  File "./weatherstation.py", line 395, in web_server
    self.server = Server(('', self.port), weather_data_handler)
  File "/usr/lib/python3.5/socketserver.py", line 440, in __init__
    self.server_bind()
  File "/usr/lib/python3.5/http/server.py", line 138, in server_bind
    socketserver.TCPServer.server_bind(self)
  File "/usr/lib/python3.5/socketserver.py", line 454, in server_bind
    self.socket.bind(self.server_address)
OSError: [Errno 98] Address already in use

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.5/threading.py", line 862, in run
    self._target(*self._args, **self._kwargs)
  File "./weatherstation.py", line 400, in web_server
    self.server.socket.close()
AttributeError: 'Controller' object has no attribute 'server'
2018-10-27 18:06:00,350 INFO     Adding node WeatherPoly(weather)
2018-10-27 18:06:00,351 INFO     Waiting on Controller node to be added.......

Link to comment
Share on other sites

I updated the port to 8888 so it didn't conflict but it's still not showing up. I've tried in in a number of different "slots" but the results are the same. I found this in the Polyglot log:

2018-10-28 14:50:38 - debug: ISY: 401 - https://10.42.8.81:443/rest/ns/3/nodes/n003_weather/add/WeatherPoly?primary=n003_weather&name=WeatherPoly
2018-10-28 14:50:38 - info: WeatherPoly(3): completed adding node(s).
2018-10-28 14:50:38 - debug: ISY: 400 - https://10.42.8.81:443/rest/ns/3/nodes/n003_weather/add/WeatherPoly?primary=n003_weather&name=WeatherPoly
2018-10-28 14:50:38 - debug: ISY 400 Add Response: n003_weather Reason: 2002
2018-10-28 14:50:38 - error: WeatherPoly(3): n003_weather was not added sucessfully. ISY returned Reason: 2002
2018-10-28 14:50:38 - error: addNode: failure, node removed :: Error: n003_weather was not added sucessfully. ISY returned Reason: 2002

Link to comment
Share on other sites

On 10/27/2018 at 4:15 PM, DaveStLou said:

My update didn't go smoothly. I'm seeing this error in the WeatherPoly log:

2018-10-27 18:06:00,257 INFO     WeatherPoly Node Server Started.
2018-10-27 18:06:00,258 INFO     Configuration Change...
2018-10-27 18:06:00,258 INFO     Web server failed to start.

This is probably because Polyglot didn't actually stop the WeatherPoly node server before it tried to start again. I've had this problem quite a bit and it's been reported by others as well.  At this point, I don't believe that there's anything I can do in the node server to change this behavior. 

Running 'ps axuww | grep weatherstation' will show if it's running and how many copies are running.  Normally, you'll see 2 entries

/bin/sh -c /usr/bin/env python3 ./weatherstation.py
python3 ./weatherstation.py

What typically happens is that the first process is terminated when you stop the node server, but the second process continues.  They both should terminate when the node server is stopped.

 

20 hours ago, DaveStLou said:

I updated the port to 8888 so it didn't conflict but it's still not showing up. I've tried in in a number of different "slots" but the results are the same. I found this in the Polyglot log:

2018-10-28 14:50:38 - debug: ISY: 401 - https://10.42.8.81:443/rest/ns/3/nodes/n003_weather/add/WeatherPoly?primary=n003_weather&name=WeatherPoly
2018-10-28 14:50:38 - info: WeatherPoly(3): completed adding node(s).
2018-10-28 14:50:38 - debug: ISY: 400 - https://10.42.8.81:443/rest/ns/3/nodes/n003_weather/add/WeatherPoly?primary=n003_weather&name=WeatherPoly
2018-10-28 14:50:38 - debug: ISY 400 Add Response: n003_weather Reason: 2002
2018-10-28 14:50:38 - error: WeatherPoly(3): n003_weather was not added sucessfully. ISY returned Reason: 2002
2018-10-28 14:50:38 - error: addNode: failure, node removed :: Error: n003_weather was not added sucessfully. ISY returned Reason: 2002

I'm not sure what reason 2002 is.

Polyglot has a known issue where it doesn't clean up it's database correctly in certain cases. The symptom I've seen, is that it says it created the nodes, but nothing happens on the ISY.  I end up running 

mongo polyglot --eval "db.nodes.remove({'profileNum':'5'})"

After deleting the node server. The profile number (5) is the slot number that the node server was installed at.  This seems to clean up the database and allows the node server to install properly.

At this point, I'd suggest starting over. Delete the node server via Polyglot, Run the command above, and also delete the node server on the ISY.   Also, you probably need to make sure all copies of the node server are killed off. Then re-add from Polyglot.

There have been a couple of times I've managed to get things into a state where that's the only way I could get things working again.

Link to comment
Share on other sites

4 hours ago, bpwwer said:

This is probably because Polyglot didn't actually stop the WeatherPoly node server before it tried to start again. I've had this problem quite a bit and it's been reported by others as well.  At this point, I don't believe that there's anything I can do in the node server to change this behavior. 

Running 'ps axuww | grep weatherstation' will show if it's running and how many copies are running.  Normally, you'll see 2 entries


/bin/sh -c /usr/bin/env python3 ./weatherstation.py
python3 ./weatherstation.py

What typically happens is that the first process is terminated when you stop the node server, but the second process continues.  They both should terminate when the node server is stopped.

Strange. After deleting the node server, restarting Polyglot and even after rebooting it still shows one copy running:

pi@pi1:~ $ ps axuww | grep weatherstation
pi        1149  0.0  0.0   4376   572 pts/0    S+   15:27   0:00 grep --color=auto weatherstation

 

Link to comment
Share on other sites

4 minutes ago, DaveStLou said:

Strange. After deleting the node server, restarting Polyglot and even after rebooting it still shows one copy running:


pi@pi1:~ $ ps axuww | grep weatherstation
pi        1149  0.0  0.0   4376   572 pts/0    S+   15:27   0:00 grep --color=auto weatherstation

 

All you're seeing is the command you're running to see if any are running (ok, that sounds confusing).  

When you run that command, it is actually running 2 commands.  The second command is 'grep weatherstation'.   The 'ps auxww' is listing all of the commands running on your system.  The combination of the two is reporting all of the commands running on the system that have 'weatherstation' as part of the command.  I do this so often that I kind of ignore the fact that running the command to check always has itself in the output.

You really just need to look for the lines with 'python3 weatherstation' in the output, that is the actual node server program, actively running.  

  • Like 1
Link to comment
Share on other sites

22 minutes ago, DaveStLou said:

Strange. After deleting the node server, restarting Polyglot and even after rebooting it still shows one copy running:


pi@pi1:~ $ ps axuww | grep weatherstation
pi        1149  0.0  0.0   4376   572 pts/0    S+   15:27   0:00 grep --color=auto weatherstation

 

Actually, that's just showing you that the "grep" command is running (and the slight difference in the command is because grep is often set as an alias for "grep --color=auto", thus the last part of your command expands to that full command when run).

  • Like 1
Link to comment
Share on other sites

5 hours ago, bpwwer said:

I'm not sure what reason 2002 is.

Polyglot has a known issue where it doesn't clean up it's database correctly in certain cases. The symptom I've seen, is that it says it created the nodes, but nothing happens on the ISY.  I end up running 


mongo polyglot --eval "db.nodes.remove({'profileNum':'5'})"

After deleting the node server. The profile number (5) is the slot number that the node server was installed at.  This seems to clean up the database and allows the node server to install properly.

At this point, I'd suggest starting over. Delete the node server via Polyglot, Run the command above, and also delete the node server on the ISY.   Also, you probably need to make sure all copies of the node server are killed off. Then re-add from Polyglot.

There have been a couple of times I've managed to get things into a state where that's the only way I could get things working again.

I started over completing (well almost) including deleting the folder on the RPi and running the database cleanup command above. When I attempted to start again it complained about not finding the nodedef subdirectory in the profile directory until I created it manually. 

I can see the WeatherPoly in the Node Servers listed in the drop down at the top of the Admin Console but I see no nodes at all.

In the Polyglot log I'm still seeing the Reason 2002 error:

2018-10-29 17:05:26 - debug: ISY: 401 - https://10.42.8.81:443/rest/ns/5/nodes/n005_weather/add/WeatherPoly?primary=n005_weather&name=WeatherPoly
2018-10-29 17:05:26 - info: WeatherPoly(5): completed adding node(s).
2018-10-29 17:05:26 - debug: ISY: 400 - https://10.42.8.81:443/rest/ns/5/nodes/n005_weather/add/WeatherPoly?primary=n005_weather&name=WeatherPoly
2018-10-29 17:05:26 - debug: ISY 400 Add Response: n005_weather Reason: 2002
2018-10-29 17:05:26 - error: WeatherPoly(5): n005_weather was not added sucessfully. ISY returned Reason: 2002
2018-10-29 17:05:26 - error: addNode: failure, node removed :: Error: n005_weather was not added sucessfully. ISY returned Reason: 2002
    at Object.doNodeAdd (/snapshot/polyglot-v2/lib/modules/nodeserver.js:293:17)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

I decided not to make any changes to the configuration (port or units) just to be sure they weren't causing something but no joy.

Link to comment
Share on other sites

1 hour ago, DaveStLou said:

I started over completing (well almost) including deleting the folder on the RPi and running the database cleanup command above. When I attempted to start again it complained about not finding the nodedef subdirectory in the profile directory until I created it manually. 

I can see the WeatherPoly in the Node Servers listed in the drop down at the top of the Admin Console but I see no nodes at all.

In the Polyglot log I'm still seeing the Reason 2002 error:


2018-10-29 17:05:26 - debug: ISY: 401 - https://10.42.8.81:443/rest/ns/5/nodes/n005_weather/add/WeatherPoly?primary=n005_weather&name=WeatherPoly
2018-10-29 17:05:26 - info: WeatherPoly(5): completed adding node(s).
2018-10-29 17:05:26 - debug: ISY: 400 - https://10.42.8.81:443/rest/ns/5/nodes/n005_weather/add/WeatherPoly?primary=n005_weather&name=WeatherPoly
2018-10-29 17:05:26 - debug: ISY 400 Add Response: n005_weather Reason: 2002
2018-10-29 17:05:26 - error: WeatherPoly(5): n005_weather was not added sucessfully. ISY returned Reason: 2002
2018-10-29 17:05:26 - error: addNode: failure, node removed :: Error: n005_weather was not added sucessfully. ISY returned Reason: 2002
    at Object.doNodeAdd (/snapshot/polyglot-v2/lib/modules/nodeserver.js:293:17)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

I decided not to make any changes to the configuration (port or units) just to be sure they weren't causing something but no joy.

I thought I had fixed it to create the nodedef directory but maybe that was a different node server.  Thanks for pointing that out.

Did you remove the node server from the ISY before trying to add it back via Polyglot? I.E. did you go into the configuration for slot 5 and delete it?   Not sure if that makes any difference, but at least then you know there's nothing old sitting on the ISY.

The first line of your log shows a 401 error, that's what the ISY returns if the username/password is missing or incorrect.

Link to comment
Share on other sites

2 hours ago, bpwwer said:

Did you remove the node server from the ISY before trying to add it back via Polyglot? I.E. did you go into the configuration for slot 5 and delete it?   Not sure if that makes any difference, but at least then you know there's nothing old sitting on the ISY.

The first line of your log shows a 401 error, that's what the ISY returns if the username/password is missing or incorrect.

I looked for the node server in ISY but there was no sign of it after I removed it from the Polyglot server.

On the 401 error, for some reason the password had disappeared from the Polyglot server. Once I entered it that went away.

Is there a resource for finding out what the Reason 2002 means?

Edited by DaveStLou
Link to comment
Share on other sites

14 hours ago, DaveStLou said:

I looked for the node server in ISY but there was no sign of it after I removed it from the Polyglot server.

On the 401 error, for some reason the password had disappeared from the Polyglot server. Once I entered it that went away.

Is there a resource for finding out what the Reason 2002 means?

Did you also delete the node server from Polyglot and try a full re-install?  It sounds like it may have failed to install on the ISY because of the password, but then thinks it is installed so doesn't try again.  Then when it tries to create the nodes, that fails because the node server configuration hasn't been installed on the ISY.

When things work, it goes pretty smooth, but when it doesn't, it seems to be quite difficult to get everything back to a state where it starts working again.  My new method to deal with some of this is to delete the node server via Polyglot, check and delete the config on the ISY if it still exist, run the mongodb command to clear out that slot in Polyglot, and then try to re-install the node server. So far, I've been pretty successful doing that.

I wasn't able to find any reference to reason 2002 in any of the documentation sources I have.  I'll see what I can find out.  

You're not the only one to encounter issues like this, I've seen a few reports of similar issues with other node servers. 

Link to comment
Share on other sites

10 hours ago, bpwwer said:

Did you also delete the node server from Polyglot and try a full re-install?  It sounds like it may have failed to install on the ISY because of the password, but then thinks it is installed so doesn't try again.  Then when it tries to create the nodes, that fails because the node server configuration hasn't been installed on the ISY.

Deleted the nodesever from ISY, then Polyglot and deleted the folder. Did have to kill the process that was still running. Restarted Polyglot.  Cleaned the database. Downloaded from GitHub again, created the nodedef folder and added the nodeserver back into Polyglot. Unfortunately, the same results.

2018-10-30 20:51:47 - debug: ISY: 401 - https://10.42.8.81:443/rest/ns/2/nodes/n002_weather/add/WeatherPoly?primary=n002_weather&name=WeatherPoly
2018-10-30 20:51:47 - info: WeatherPoly(2): completed adding node(s).
2018-10-30 20:51:47 - debug: ISY: 400 - https://10.42.8.81:443/rest/ns/2/nodes/n002_weather/add/WeatherPoly?primary=n002_weather&name=WeatherPoly
2018-10-30 20:51:47 - debug: ISY 400 Add Response: n002_weather Reason: 2002
2018-10-30 20:51:47 - error: WeatherPoly(2): n002_weather was not added sucessfully. ISY returned Reason: 2002
2018-10-30 20:51:47 - error: addNode: failure, node removed :: Error: n002_weather was not added sucessfully. ISY returned Reason: 2002
    at Object.doNodeAdd (/snapshot/polyglot-v2/lib/modules/nodeserver.js:293:17)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
2018-10-30 20:51:47 - info: WeatherPoly(2): completed adding node(s).
2018-10-30 20:51:47 - debug: ISY: 400 - https://10.42.8.81:443/rest/ns/undefined/nodes/humidity/remove
2018-10-30 20:51:47 - error: removenode: Error: ISY sent invalid result code.
    at Object.removenode (/snapshot/polyglot-v2/lib/modules/nodeserver.js:445:24)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

×
×
  • Create New...