Jeesh, its amazing what ‘people’ will ‘stuff’ into an MQTT message….
The ‘header information’ (POST, HOST, etc.) is making ‘invalid keyword’ 
data for MQTTSubsribe. It’s obviously not json….
It’s gonna’ take a bit of work to figure out how to best parse this.
rich


On Thursday, 20 August 2026 at 17:45:50 UTC-4 Christian Peters wrote:

> ...some more form the debug output:
>
> 2026-08-20T23:42:42.285624+02:00 weewx weewxd[1953952]: DEBUG 
> user.MQTTSubscribe: (Service) MessageCallbackProvider data-> incoming 
> topic: ecowitt/gw1000, QOS: 0, retain: False, payload: b'POST /data/ip_api/ 
> HTTP/1.1\r\nHOST: cdnrtpdate.ecowitt.net\r\nConnection: 
> Close\r\nContent-Type: application/x-www-form-urlencoded\r\nContent-Length: 
> 353\r\n\r\nPASSKEY=7EDF1C083D41E2564A22B916BBD1979C&stationtype=GW1200A_V1.4.8&runtime=1789501&heap=88084&dateutc=2026-08-20+21%3A42%3A41&dns_err_cnt=2&cdnflg=1&adc=1007,987,987,987,988&freq_volt=758&tempinf=75.74&humidityin=44&baromrelin=29.849&baromabsin=28.381&lightning_num=0&lightning=34&lightning_time=1787171122&wh57batt=5&freq=868M&model=GW1200A&interval=0'
> 2026-08-20T23:42:42.286317+02:00 weewx weewxd[1953952]: ERROR 
> user.MQTTSubscribe: (Service) MessageCallbackProvider on_message_keyword 
> failed to find separator: &
> 2026-08-20T23:42:42.287209+02:00 weewx weewxd[1953952]: ERROR 
> user.MQTTSubscribe: (Service) **** MessageCallbackProvider Skipping 
> field=POST /data/ip_api/ HTTP/1.1#015#012HOST: 
> cdnrtpdate.ecowitt.net#015#012Connection 
> <http://cdnrtpdate.ecowitt.net#015%23012Connection>: 
> Close#015#012Content-Type: 
> application/x-www-form-urlencoded#015#012Content-Length: 
> 353#015#012#015#012PASSKEY 
> 2026-08-20T23:42:42.287600+02:00 weewx weewxd[1953952]: ERROR 
> user.MQTTSubscribe: (Service) MessageCallbackProvider on_message_keyword 
> failed with <class 'user.MQTTSubscribe.ConversionError'> and reason Failed 
> converting field 7EDF1C083D41E2564A22B916BBD1979C with value stationtype 
> using 'lambda x: to_float(x)' with reason could not convert string to 
> float: 'stationtype'..
> 2026-08-20T23:42:42.287951+02:00 weewx weewxd[1953952]: ERROR 
> user.MQTTSubscribe: (Service) **** MessageCallbackProvider Ignoring 
> topic=ecowitt/gw1000 and payload=b'POST /data/ip_api/ HTTP/1.1\r\nHOST: 
> cdnrtpdate.ecowitt.net\r\nConnection: Close\r\nContent-Type: 
> application/x-www-form-urlencoded\r\nContent-Length: 
> 353\r\n\r\nPASSKEY=7EDF1C083D41E2564A22B916BBD1979C&stationtype=GW1200A_V1.4.8&runtime=1789501&heap=88084&dateutc=2026-08-20+21%3A42%3A41&dns_err_cnt=2&cdnflg=1&adc=1007,987,987,987,988&freq_volt=758&tempinf=75.74&humidityin=44&baromrelin=29.849&baromabsin=28.381&lightning_num=0&lightning=34&lightning_time=1787171122&wh57batt=5&freq=868M&model=GW1200A&interval=0'
> 2026-08-20T23:42:42.291204+02:00 weewx weewxd[1953952]: ERROR 
> user.MQTTSubscribe: (Service) **** MessageCallbackProvider Traceback (most 
> recent call last):#012  File "/etc/weewx/bin/user/MQTTSubscribe.py", line 
> 1441, in _convert_value#012    return 
> conversion_func['compiled'](value)#012           
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^#012  File "<string>", line 1, in 
> <lambda>#012  File "/usr/share/weewx/weeutil/weeutil.py", line 1585, in 
> to_float#012    return float(x) if x is not None else None#012           
> ~~~~~^^^#012ValueError: could not convert string to float: 
> 'stationtype'#012#012The above exception was the direct cause of the 
> following exception:#012#012Traceback (most recent call last):#012  File 
> "/etc/weewx/bin/user/MQTTSubscribe.py", line 1560, in 
> _on_message_keyword#012    (fieldname, value) = self._update_data(key, 
> field[eq_index + 1:].strip(), fields, fields_conversion_func, 
> unit_system)#012                         
> ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#012
>  
>  File "/etc/weewx/bin/user/MQTTSubscribe.py", line 1400, in 
> _update_data#012    value = self._convert_value(fields, 
> default_field_conversion_func, orig_name, orig_value)#012  File 
> "/etc/weewx/bin/user/MQTTSubscribe.py", line 1446, in _convert_value#012   
>  raise ConversionError(#012        f"Failed converting field {field} with 
> value {value} using '{conversion_func['source']}' with reason 
> {exception}.")\#012            from 
> exception#012user.MQTTSubscribe.ConversionError: Failed converting field 
> 7EDF1C083D41E2564A22B916BBD1979C with value stationtype using 'lambda x: 
> to_float(x)' with reason could not convert string to float: 'stationtype'.
>
> Christian Peters schrieb am Donnerstag, 20. August 2026 um 23:39:14 UTC+2:
>
>> Hi all, 
>>
>> I just tried to integrate a lightning sensor attached to the GW1200 
>> Gateway into weewx with MQTTSubscribe 
>> <https://github.com/bellrichm/WeeWX-MQTTSubscribe/blob/master/bin/user/MQTTSubscribe.py>
>> .
>> I enablede MQTT in the GW1200 but I struggle to get the data parsed. 
>>
>> The problem seems to be this added header in the MQTT message..?!
>> Any chance to get it working I didn't find a solution.
>>
>> The MQTT message from the GW1200:
>>
>> POST /data/ip_api/ HTTP/1.1
>> HOST: cdnrtpdate.ecowitt.net
>> Connection: Close
>> Content-Type: application/x-www-form-urlencoded
>> Content-Length: 353
>>
>>
>> PASSKEY=7EDF1C083D41E2564A22B916BBD1979C&stationtype=GW1200A_V1.4.8&runtime=1788421&heap=88084&dateutc=2026-08-20+21%3A24%3A41&dns_err_cnt=2&cdnflg=1&adc=1007,987,987,987,988&freq_volt=758&tempinf=75.92&humidityin=44&baromrelin=29.840&baromabsin=28.372&lightning_num=0&lightning=34&lightning_time=1787171122&wh57batt=5&freq=868M&model=GW1200A&interval=0
>>
>> My config for MQTTSubscribeService VERSION = '3.1.0-rc01', running as a 
>> service:
>>
>>         [[[ecowitt/gw1000]]]    # The topic you are subscribing to
>>            ignore = false
>>             unit_system = METRICWX    # Not sure weather you want 
>> METRICWX or METRIC. See http://weewx.com/docs/customizing.htm#units
>>
>>             [[[[message]]]]
>>                 type = keyword
>>                 keyword_delimiter = "&"
>>             # map MQTT field to WeeWX database field    
>>
>>             [[[[PASSKEY]]]]
>>                 ignore = True
>>             [[[[stationtype]]]]
>>                 ignore = True
>>             [[[[runtime]]]]
>>                 ignore = True
>>             [[[[heap]]]]
>>
>>                 ignore = True
>>             [[[[dateutc]]]]
>>                 ignore = True
>>             [[[[dns_err_cnt]]]]
>>                 ignore = True
>>             [[[[cdnflg]]]]
>>                 ignore = True            
>>             [[[[adc]]]]
>>                 ignore = True            
>>             [[[[freq_volt]]]]
>>                 ignore = True
>>             [[[[tempinf]]]]
>>                 ignore = True
>>             [[[[humidityin]]]]
>>                 ignore = True
>>             [[[[baromrelin]]]]
>>                 ignore = True
>>             [[[[baromabsin]]]]
>>                 ignore = True
>>             [[[[wh57batt]]]]
>>
>>                 ignore = True
>>             [[[[freq]]]]
>>                 ignore = True
>>             [[[[model]]]]
>>                 ignore = True
>>             [[[[interval]]]]
>>                 ignore = True
>>
>>             [[[[lightning]]]]
>>                 name = lightning_dist
>>             [[[[lightning_num]]]]
>>                 name = lightning_strike_count
>>             [[[[lightning_time]]]]
>>                 name = lightning_last_det_time
>>
>> My error/debug output form weewx:
>>
>> 2026-08-20T23:11:41.607918+02:00 weewx weewxd[1953952]: DEBUG 
>> user.MQTTSubscribe: (Service) MessageCallbackProvider data-> incoming 
>> topic: ecowitt/gw1000, QOS: 0, retain: False, payload: b'POST /data/ip_api/ 
>> HTTP/1.1\r\nHOST: cdnrtpdate.ecowitt.net\r\nConnection: 
>> Close\r\nContent-Type: application/x-www-form-urlencoded\r\nContent-Length: 
>> 353\r\n\r\nPASSKEY=7EDF1C083D41E2564A22B916BBD1979C&stationtype=GW1200A_V1.4.8&runtime=1787641&heap=88084&dateutc=2026-08-20+21%3A11%3A41&dns_err_cnt=2&cdnflg=1&adc=1007,987,987,987,988&freq_volt=758&tempinf=76.10&humidityin=44&baromrelin=29.843&baromabsin=28.375&lightning_num=0&lightning=34&lightning_time=1787171122&wh57batt=5&freq=868M&model=GW1200A&interval=0'
>> 2026-08-20T23:11:41.608973+02:00 weewx weewxd[1953952]: ERROR 
>> user.MQTTSubscribe: (Service) **** MessageCallbackProvider Ignoring 
>> topic=ecowitt/gw1000 and payload=b'POST /data/ip_api/ HTTP/1.1\r\nHOST: 
>> cdnrtpdate.ecowitt.net\r\nConnection: Close\r\nContent-Type: 
>> application/x-www-form-urlencoded\r\nContent-Length: 
>> 353\r\n\r\nPASSKEY=7EDF1C083D41E2564A22B916BBD1979C&stationtype=GW1200A_V1.4.8&runtime=1787641&heap=88084&dateutc=2026-08-20+21%3A11%3A41&dns_err_cnt=2&cdnflg=1&adc=1007,987,987,987,988&freq_volt=758&tempinf=76.10&humidityin=44&baromrelin=29.843&baromabsin=28.375&lightning_num=0&lightning=34&lightning_time=1787171122&wh57batt=5&freq=868M&model=GW1200A&interval=0'
>>
>> Any help would be appreciated. 
>> Maybe bellrichm could give some hints to get it working...!?
>>
>> Thanks in advance! 
>>
>> Christian 
>>
>>
>>
>>
>> vince schrieb am Freitag, 10. Oktober 2025 um 00:08:29 UTC+2:
>>
>>> Just a quick update - the GW1200 with latest V1.4.0 firmware now 
>>> supports posting to MQTT too.
>>>
>>> I enabled it for a quick test and poked around a little with 
>>> mosquitto_sub to look at what it sends and it looks like the same data 
>>> elements that I'm getting for Gary's legacy GW1000 driver plus one 
>>> additional element "srain_piezo" which we neglected to make known to his 
>>> driver last year when I was working with him to support the WS85.  My best 
>>> guess is that it means "state of raining (or not) on the piezo sensor" 
>>> where 0 = not raining, 1 = raining.
>>>
>>> Upside is you can set MQTT to send data as frequently as every 10 
>>> seconds.  Downside is the sensors don't send data that often so kinda why 
>>> bother running faster than maybe every 30 seconds.
>>>
>>> Re: the use of & my guess is this is WU protocol.  If you subscribe to 
>>> topic_name/# you see a header ala:
>>>
>>> POST /data/ip_api/ HTTP/1.1
>>> HOST: cdnrtpdate.ecowitt.net
>>> Connection: Close
>>> Content-Type: application/x-www-form-urlencoded
>>> Content-Length: 925
>>>
>>> I have never configured my gateway to talk to ecowitt, so I don't know 
>>> if it's actually trying to post data to ecowitt's servers (or not), but it 
>>> sure looks fishy to me.
>>>
>>> On Friday, August 22, 2025 at 6:24:24 AM UTC-7 Paul R Anderson wrote:
>>>
>>> That sounds like a great "work around" for some who use WeeWX. But I 
>>> really wish the underlying  issue of using a non standard separator, 
>>> which does not comply with the published MQTT standard.could be addressed 
>>> and fixed.* Design a device that offers to publish to a MQTT server, 
>>> make it standard compliant* , so that it will be easy to subscribe to 
>>> that topic on a wide range of MQTT clients.
>>>
>>>
>>>  
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/weewx-user/e7cb344a-2407-4663-8836-57d13a19874en%40googlegroups.com.

Reply via email to