captain-coredump / weatherflow-udp

WeatherFlow Personal Weather Station driver for weewx, via UDP broadcast packets
GNU General Public License v3.0
54 stars 19 forks source link

Not 'configurator_loader' #4

Closed MechEng70 closed 6 years ago

MechEng70 commented 6 years ago

Getting this error when attempting to run weewx with the plugin.

Jun 19 07:04:18 NodePi weewx[27339]: for packet in self.console.genLoopPackets(): Jun 19 07:04:18 NodePi weewx[27339]: File "/usr/share/weewx/user/weatherflowudp.py", line 271, in genLoopPackets Jun 19 07:04:18 NodePi weewx[27339]: s.bind((self._udp_address,self._udp_port)) Jun 19 07:04:18 NodePi weewx[27339]: File "/usr/lib/python2.7/socket.py", line 228, in meth Jun 19 07:04:18 NodePi weewx[27339]: * return getattr(self._sock,name)(args) Jun 19 07:04:18 NodePi weewx[27339]: ** error: [Errno 98] Address already in use Jun 19 07:04:18 NodePi weewx[27339]: **** Exiting. Jun 19 07:05:38 NodePi wee_device[27414]: The driver user.weatherflowudp does not include a configuration tool: 'module' object has no attribute 'configurator_loader' Jun 19 07:06:36 NodePi wee_device[27481]: The driver user.weatherflowudp does not include a configuration tool: 'module' object has no attribute 'configurator_loader'

captain-coredump commented 6 years ago

Is there another instance or program running and listening forWeatherFlow UDP? I assume that this is from a Linux or Raspberry Pi system. The call that I used to open the connection does not share itwith other programs/instances, and this error looks like it isa failure to open the UDP socket for exclusive access becausesomething else is listening on it. Another user sent me a few minor changes to let the drivershare the socket with other programs/instances.  I have nothad a chance to make the suggested edits and test it yet,but will try to do it tonight to prevent this from happeningto anyone else.....

  From: MechEng70 <notifications@github.com>

To: captain-coredump/weatherflow-udp weatherflow-udp@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Sent: Tuesday, June 19, 2018 7:10 AM Subject: [captain-coredump/weatherflow-udp] Not 'configurator_loader' (#4)

Getting this error when attempting to run weewx with the plugin.Jun 19 07:04:18 NodePi weewx[27339]: for packet in self.console.genLoopPackets(): Jun 19 07:04:18 NodePi weewx[27339]: File "/usr/share/weewx/user/weatherflowudp.py", line 271, in genLoopPackets Jun 19 07:04:18 NodePi weewx[27339]: s.bind((self._udp_address,self._udp_port)) Jun 19 07:04:18 NodePi weewx[27339]: File "/usr/lib/python2.7/socket.py", line 228, in meth Jun 19 07:04:18 NodePi weewx[27339]: * return getattr(self._sock,name)(args) Jun 19 07:04:18 NodePi weewx[27339]: ** error: [Errno 98] Address already in use Jun 19 07:04:18 NodePi weewx[27339]: **** Exiting. Jun 19 07:05:38 NodePi wee_device[27414]: The driver user.weatherflowudp does not include a configuration tool: 'module' object has no attribute 'configurator_loader' Jun 19 07:06:36 NodePi wee_device[27481]: The driver user.weatherflowudp does not include a configuration tool: 'module' object has no attribute 'configurator_loader'— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

captain-coredump commented 6 years ago

 If you want to try the edits on your own, this is what he sent: ...but I made some small change to your driver you might consider

        s=socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)         s.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1)         s.bind(("0.0.0.0",self._udp_port))         s.settimeout(self._udp_timeout)

In particular line 2 above lets more than one client listen for packets since in my case...

  From: MechEng70 <notifications@github.com>

To: captain-coredump/weatherflow-udp weatherflow-udp@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Sent: Tuesday, June 19, 2018 7:10 AM Subject: [captain-coredump/weatherflow-udp] Not 'configurator_loader' (#4)

Getting this error when attempting to run weewx with the plugin.Jun 19 07:04:18 NodePi weewx[27339]: for packet in self.console.genLoopPackets(): Jun 19 07:04:18 NodePi weewx[27339]: File "/usr/share/weewx/user/weatherflowudp.py", line 271, in genLoopPackets Jun 19 07:04:18 NodePi weewx[27339]: s.bind((self._udp_address,self._udp_port)) Jun 19 07:04:18 NodePi weewx[27339]: File "/usr/lib/python2.7/socket.py", line 228, in meth Jun 19 07:04:18 NodePi weewx[27339]: * return getattr(self._sock,name)(args) Jun 19 07:04:18 NodePi weewx[27339]: ** error: [Errno 98] Address already in use Jun 19 07:04:18 NodePi weewx[27339]: **** Exiting. Jun 19 07:05:38 NodePi wee_device[27414]: The driver user.weatherflowudp does not include a configuration tool: 'module' object has no attribute 'configurator_loader' Jun 19 07:06:36 NodePi wee_device[27481]: The driver user.weatherflowudp does not include a configuration tool: 'module' object has no attribute 'configurator_loader'— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

MechEng70 commented 6 years ago

I am running the weatherflow node server for the isy home automation hub. That is probably the issue.

MechEng70 commented 6 years ago

Made those changes... stoped the service and restarted. now this error:

Jun 19 10:40:38 NodePi weewx[29487]: type object '_socketobject' has no attribute 'socket' Jun 19 10:40:38 NodePi weewx[29487]: Traceback (most recent call last): Jun 19 10:40:38 NodePi weewx[29487]: File "/usr/share/weewx/weewx/engine.py", line 871, in main Jun 19 10:40:38 NodePi weewx[29487]: engine.run() Jun 19 10:40:38 NodePi weewx[29487]: File "/usr/share/weewx/weewx/engine.py", line 187, in run Jun 19 10:40:38 NodePi weewx[29487]: for packet in self.console.genLoopPackets(): Jun 19 10:40:38 NodePi weewx[29487]: File "/usr/share/weewx/user/weatherflowudp.py", line 273, in genLoopPackets Jun 19 10:40:38 NodePi weewx[29487]: s=socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP) Jun 19 10:40:38 NodePi weewx[29487]: AttributeError: type object '_socketobject' has no attribute 'socket' Jun 19 10:40:38 NodePi weewx[29487]: Exiting.

MechEng70 commented 6 years ago

This is what I have in the .py file. s=socket(AF_INET, SOCK_DGRAM)

s.bind((self._udp_address,self._udp_port))

    #s.settimeout(self._udp_timeout)
    s=socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
    s.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1)
    s.bind(("0.0.0.0",self._udp_port))
    s.settimeout(self._udp_timeout)

I commented out the 2nd and 3rd line.

captain-coredump commented 6 years ago

I will take a look at it after work, when I have access totest it properly.....

  From: MechEng70 <notifications@github.com>

To: captain-coredump/weatherflow-udp weatherflow-udp@noreply.github.com Cc: Arthur Emerson vreihen@yahoo.com; Comment comment@noreply.github.com Sent: Tuesday, June 19, 2018 10:47 AM Subject: Re: [captain-coredump/weatherflow-udp] Not 'configurator_loader' (#4)

This is what I have in the .py file. s=socket(AF_INET, SOCK_DGRAM)

s.bind((self._udp_address,self._udp_port))

s.settimeout(self._udp_timeout)

s=socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP) s.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1) s.bind(("0.0.0.0",self._udp_port)) s.settimeout(self._udp_timeout)I commented out the 2nd and 3rd line.— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

MechEng70 commented 6 years ago

Thanks. No hurry as I left the house for the next 72 hrs. I can ssh in if I get a chance.

captain-coredump commented 6 years ago

FYI, this is what I just did on my test Raspberry Pi weewx setup: s=socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP) s.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1) s.bind((self._udp_address,self._udp_port)) s.settimeout(self._udp_timeout)I was able to start two weewx instances with both listening to the same socket, so I am somewhat confident that it will solve your error. Please let me know either way.Note to anyone else with this problem:Since I am obsessive about testing before sharing code, I am going to let this run in my test environment until the weekend before committing the next point release with this change to GitHub. That commit will also make using the shared sockets into a weewx.conf config option, as I will not have a chance to adequately test it against MacOS and several other Python platforms that may have problems sharing a socket before then.....

MechEng70 commented 6 years ago

I ssh'ed in and updated it. Seems to be running. I'll check later. Thanks.

MechEng70 commented 6 years ago

How do I get it to not use the simulator? I did the reconfigure and it sees the weatherflowudp. Did I miss something?

screenshot_20180619-175823

screenshot_20180619-175740

captain-coredump commented 6 years ago

In /etc/weewx/weewx.conf:

Set to type of station hardware. There must be a corresponding stanza

# in this file with a 'driver' parameter indicating the driver to be used.
station_type = WeatherFlowUDPI assume that you also put in a device stanza at the end of your weewx.conf

file, per the readme file. This is one of my test ones. If you have not built the sensor_map yet, put your Air and Sky device addresses in place of mine and it should be enough to get things running:[WeatherFlowUDP]

This section is for the WeatherFlow Bridge packets, via UDP broadcast on local subnet

driver = user.weatherflowudp
#log_raw_packets = True
log_raw_packets = False
udp_address = <broadcast>
# udp_address = 0.0.0.0
# udp_address = 255.255.255.255
udp_port = 50222
udp_timeout = 90

    share_socket = True

[[sensor_map]]
    outTemp = air_temperature.AR-00012619.obs_air
    outHumidity = relative_humidity.AR-00012619.obs_air
    pressure = station_pressure.AR-00012619.obs_air
    #lightning_strikes =  lightning_strike_count.AR-00012619.obs_air
    #avg_distance =  lightning_strike_avg_distance.AR-00012619.obs_air
    outTempBatteryStatus = battery.AR-00012619.obs_air
    windSpeed = wind_speed.SK-00001306.rapid_wind
    windDir = wind_direction.SK-00001306.rapid_wind
    #luxXXX = illuminance.SK-00001306.obs_sky
    UV = uv.SK-00001306.obs_sky
    rain = rain_accumulated.SK-00001306.obs_sky
    windBatteryStatus = battery.SK-00001306.obs_sky
    radiation = solar_radiation.SK-00001306.obs_sky
    #lightningXXX = distance.AR-00012619.evt_strike
    #lightningYYY = energy.AR-00012619.evt_strike
    inTemp = air_temperature.AR-00012619.obs_air
    ##inTemp = voltage.SK-00001221.device_status

  From: MechEng70 <notifications@github.com>

To: captain-coredump/weatherflow-udp weatherflow-udp@noreply.github.com Cc: Arthur Emerson vreihen@yahoo.com; Comment comment@noreply.github.com Sent: Tuesday, June 19, 2018 6:00 PM Subject: Re: [captain-coredump/weatherflow-udp] Not 'configurator_loader' (#4)

How do I get it to not use the simulator? I did the reconfigure and it sees the weatherflowudp. Did I miss something?— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

MechEng70 commented 6 years ago

Strange. I did that (following your instructions) earlier. Just redid it. Maybe I screwed up the syntax. It's running now. I'll keep watch the next few days. Thanks!!!

captain-coredump commented 6 years ago

Adding a weewx.conf option for sharing the socket will be addresses in V1.03 release in the next few days.