Thanks Gary,

I've got a few things to say to you.   Firstly - Thanks!  :-)   and also, 
thanks for the last 2.5hrs, but I worked it out.   With ZERO idea what I'm 
doing, other than the commands to get the data out of the logger.

I'm really hoping someone can make me whatever extension/driver I need to 
run import into WeeWX now, I'll be over the bloody moon.

This is my .py file:  (keep in mind I have no python knowledge at all, so 
this is copied from the net until I got it to work with only my logic).

import time,os,re,telnetlib,sys
host = "192.168.1.73"
port = "10001"

tn = telnetlib.Telnet(host, port)
tn.read_until(">", timeout=5) # <- add this line

str_all=tn.read_until("> ", timeout=10)
f=open("/usr/share/weewx/user/Live.txt", "w")
tn.write("r\r")
str_all=tn.read_until("> ", timeout=10)
f.write(str_all)
f.close()
tn.write("^] \r")
tn.write("quit \r")

This generates the live.txt file - which looks like this: the "r" at the 
top of the file is the command to retrieve latest data 

r
2021/11/05 11:14:14    Title "John"
Sensor Name                       Model   Value      Unit
  1    "Wind Speed              " (WS45): +000000.00 km/h
  2    "Wind Direction          " (WD42): +000285.84 Degs
  3    "Relative Humidity       " (RH40): +000066.00 %
  4    "Air Temperature         " (TA10): +000020.17 DegC
  5    "Barometric Pressure     " (BP41): +001019.67 hPa
  21   "Battery Voltage         " (BTVL): +000012.33 V
  22   "Load Current            " (LMA ): +000043.00 mA
  23   "Solar Voltage           " (SPVL): +000012.94 V
  24   "Charge Current          " (CMA ): +000259.87 mA
  25   "Peak Wind Gust          " (PWG ): +000000.00 km/h
  26   "Inst. Wind Speed        " (IWS ): +000000.00 km/h
  27   "Inst. Wind Direction    " (    ): +000286.65 Degs
  30   "Rain Since 9am          " (    ): +000000.00 mm
  31   "Communications          " (    ): +000001.00 Mins
> 

Thanks again 
johnny
On Friday, November 5, 2021 at 9:33:29 AM UTC+11 gjr80 wrote:

> Hi,
>
> > I'm technically capable, by comparing other files, and trial and error
> Ah, some one who uses the same coding style as me!
>
> If you can use python (python has a telnet library) to get valid and 
> consistent data out of the device it should be a simple job to add some 
> simple parsing and restructuring of the data into WeeWX loop packet format. 
> From there it would be pretty simple to fashion a WeeWX driver that polls 
> the station every so often and emits loop packets.
>
> The ‘Porting to new hardware’ section in the Customisation Guide may fill 
> in a few blanks for you (http://weewx.com/docs/customizing.htm#porting). 
> Otherwise a bit of googling should find some example python telnet code 
> that you can start off with. Once you can talk to your station with python 
> we can help you cobble together a basic driver.
>
> Gary
> On Friday, 5 November 2021 at 08:15:27 UTC+10 [email protected] wrote:
>
>> G'day team,
>>
>> I have one of these beasts, I'm trying to get data out of.
>> It uses an Xport adapter, which is just a lantronix server to stream data 
>> via telnet on port 10001.
>>
>> I can communicate and see the data on the station using basic commands, 
>> but Enviondata only support their own software.
>>
>> Anyone have any ideas how I can get weewx to talk to it?
>> here's a couple of data streams.
>>
>> When telnetting to 10001 and typing R and return=
>> > r
>> r
>> 2021/11/04 11:04:17    Title "John"
>> Sensor Name                       Model   Value      Unit
>>   1    "Wind Speed              " (WS45): +000000.05 km/h
>>   2    "Wind Direction          " (WD42): +000285.84 Degs
>>   3    "Relative Humidity       " (RH40): +000066.83 %
>>   4    "Air Temperature         " (TA10): +000023.07 DegC
>>   5    "Barometric Pressure     " (BP41): +001020.78 hPa
>>   21   "Battery Voltage         " (BTVL): +000011.95 V
>>   22   "Load Current            " (LMA ): +000043.89 mA
>>   23   "Solar Voltage           " (SPVL): +000012.41 V
>>   24   "Charge Current          " (CMA ): +000050.23 mA
>>   25   "Peak Wind Gust          " (PWG ): +000001.00 km/h
>>   26   "Inst. Wind Speed        " (IWS ): +000000.00 km/h
>>   27   "Inst. Wind Direction    " (    ): +000286.65 Degs
>>   30   "Rain Since 9am          " (    ): +000000.00 mm
>>   31   "Communications          " (    ): +000001.00 Mins
>>
>> or typing R2 =
>> > rr22
>>
>>
>> 2021/11/04,12:06:42,+000000.10,+000285.79,+000062.50,+000024.97,+001019.67,+000011.87,+000044.56,+000012.30,+000041.49,+000001.00,+000000.00,+000286.65,+000000.00,+000001.00
>> ;0911-0125         ,Wind S,Wind D,Rela H,Air  T,Baro P,Batt V,Load C,Sola 
>> V,Char C,Peak W,Inst W,Inst W,Rain S,Commun
>> ;Title "John"
>> ;Location "Riverside"
>>
>> I'm technically capable, by comparing other files, and trial and error, 
>> but really no idea where to start.
>> Thanks to any input.
>> Cheers
>> johnny
>>
>

-- 
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 on the web visit 
https://groups.google.com/d/msgid/weewx-user/cb43929c-5a2e-4564-8ce1-7002c529117cn%40googlegroups.com.

Reply via email to