Re: [weewx-user] Re: weewx server?

2023-01-06 Thread John W. Springman III
Lots of info.  Thanks.  I  have a website domain already and use a 
raspberry pi for this.  I apparently just can't seem to get it to show 
other than on the local network.  

On Thursday, January 5, 2023 at 12:13:20 PM UTC-5 pannetron wrote:

> If you host a public website from a personal Linux server, as I do, look 
> into using fail2ban as a way to detect and block some bad actor bots.  My 
> implementation currently has about 2500 IPs blocked because they were 
> looking for typical webserver security flaws.
>
> On Wednesday, January 4, 2023 at 11:11:49 AM UTC-7 do...@dougjenkins.com 
> wrote:
>
>> Glad some of you find this useful.
>>
>> I have been using this method since it came out this summer (July 2022). 
>> I run my infrastructure (Web Server, WeeWX, MQTT, MariaDB) as containers in 
>> one stack in its own network all in Docker. I do this to limit what the 
>> cloudflare tunnel can access on my network (just WeeWx stuff). All of this 
>> works in docker in one stack and one YAML file!
>>
>> Like Tom Lawerence mentioned in the video I attached, you have to put 
>> Cloudflare in your "circle of trust" as you are depending on them for both 
>> the client and server/edge side of the tunnel. You have to make that 
>> determination on your own if you are comfortable with that.
>>
>> As other methods mentioned here, they are all great alternatives. I was 
>> not aware adafriut offered a dashboard to present your data. That can be a 
>> good alternative than going through the hassle of hosting a full website 
>> for your station.
>>
>> If I get a free moment in a few weeks, I can post a step-by-step article 
>> on onboarding your WeeWX weather station as a public website using 
>> Cloudflare. I think it can help a lot of users who struggle with the 
>> network & security setup.
>>
>> DDJ
>>
>> On Wed, Jan 4, 2023 at 12:49 PM vince  wrote:
>>
>>> On Tuesday, January 3, 2023 at 6:41:01 PM UTC-8 do...@dougjenkins.com 
>>> wrote:
>>>
 If you are willing to roll up your sleeves and get technical, serving 
 your website at home can be done safely and securely without changing your 
 firewall. There are some steps to do, but at the end it will save you 
 money 
 and it will give you some real-world IT experience.


>>> Very cool - thanks for the pointer to the video.  I hadn't previously 
>>> figured out the Zero Trust terminology enough to try the tunnel stuff. I'll 
>>> have to try the tunnel thing too 
>>>
>>> For the original poster, Doug's steps 1-3 are very easy.  I'd previously 
>>> done that using Google Domains ($12/year).
>>>
>>> Note - you probably still want to possibly harden your weewx webserver a 
>>> bit.  There are zillions of bots trying to attack web servers 'especially' 
>>> all things WordPress.  If you go just with a vanilla weewx setup you're 
>>> likely in very good shape straight out of the box.  Cool cheap option for 
>>> sure.
>>>
>>> -- 
>>> 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 weewx-user+...@googlegroups.com.
>>>
>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/weewx-user/56afd382-a9ba-49e7-831f-2813872d6db0n%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>>

-- 
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 weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/fb5949ed-7a16-4c63-90e7-fa0c84e86781n%40googlegroups.com.


Re: [weewx-user] Davis VP2 reliability with Rasp Pi zero

2023-01-06 Thread Greg Troxel
"iams...@gmail.com"  writes:

> I've looked into getting a UPS for the Pi, which really appears to be 
> nothing more than a $15 ext phone battery, but it seems to me this is a 
> weewx problem that should be addressed. Alternately, I can contact Davis to 
> see what they say.
> "

It seems, from long history, that if the computer that is polling the
data logger goes away suddenly while interacting with the logger, the
logger can get messed up.   This is arguably a bug in the logger.

My advice, just like the advice you got from others, is get a UPS, which
will also help avoid filesystem mess on the RPI0.

If you want to trace what's on the serial and experiment and figure out
what's going on, you certainly can.   But, pretty much everybody with
the skills to do that believes in "you should get a UPS".

-- 
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 weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/rmisfgnyi10.fsf%40s1.lexort.com.


Re: [weewx-user] Davis VP2 reliability with Rasp Pi zero

2023-01-06 Thread spam-...@robotmonkeys.net
Sometimes the logger inside your Vp2 base station gets into a weird state. 
You can try weewx_device —dump to try and recover you missing data, but I 
often just end up running —clear and eat the loss See 
.https://www.weewx.com/docs/hardware.htm#vantage_notes
On Friday, January 6, 2023 at 6:17:05 AM UTC-6 Greg Troxel wrote:

> "iams...@gmail.com"  writes:
>
> > I've looked into getting a UPS for the Pi, which really appears to be 
> > nothing more than a $15 ext phone battery, but it seems to me this is a 
> > weewx problem that should be addressed. Alternately, I can contact Davis 
> to 
> > see what they say.
> > "
>
> It seems, from long history, that if the computer that is polling the
> data logger goes away suddenly while interacting with the logger, the
> logger can get messed up. This is arguably a bug in the logger.
>
> My advice, just like the advice you got from others, is get a UPS, which
> will also help avoid filesystem mess on the RPI0.
>
> If you want to trace what's on the serial and experiment and figure out
> what's going on, you certainly can. But, pretty much everybody with
> the skills to do that believes in "you should get a UPS".
>

-- 
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 weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/235901d4-9cf2-4177-8d19-89e63b20cfe4n%40googlegroups.com.


Re: [weewx-user] Davis VP2 reliability with Rasp Pi zero

2023-01-06 Thread Tom Keffer
If weewx causes the corruption, I sure don't see how. It operates well
within the published API provided by Davis.

Graham is probably right: a power spike from when power comes on is likely
the problem. It's coming through either the VP2 power supply or, more
likely, the Pi's.

Try at least a surge suppressor. A UPS would be even better.

On Thu, Jan 5, 2023 at 5:46 PM iams...@gmail.com  wrote:

> "What happens if you 'pull the plug' on your VP2? Does it keep running?
> Perhaps the batteries are bad?
>
> Yes, it keeps running, that is why it seems to be a weewx issue to me. In
> other words, if the Pi Zero running weewx were not connected to the VP2,
> the data logger memory would not get corrupted. In fact, weewx is able to
> recover data that was gathered during the power outage (while the Pi is
> shut down). It is only when power is *restored *that the data logger
> corruption happens. At least I assume that is really the root of the issue,
> I really don't know. All I know is that almost every time the power goes
> out, I get the record time error and all data recording and uploading stops.
>
> I've looked into getting a UPS for the Pi, which really appears to be
> nothing more than a $15 ext phone battery, but it seems to me this is a
> weewx problem that should be addressed. Alternately, I can contact Davis to
> see what they say.
> "
>
> On Thursday, January 5, 2023 at 3:34:40 PM UTC-8 tke...@gmail.com wrote:
>
>> It should work.
>>
>> What happens if you 'pull the plug' on your VP2? Does it keep running?
>> Perhaps the batteries are bad?
>>
>> Personally, I use a UPS for both the weewx server and the VP2 and haven't
>> had a memory corruption problem in at least a decade. So, you could try
>> that.
>>
>>
>>
>>
>> On Thu, Jan 5, 2023 at 11:30 AM iams...@gmail.com 
>> wrote:
>>
>>> I've been using weewx running on a Pi Zero with no other tasks.
>>> Unfortunately, I live in a area that suffers power losses, often during a
>>> weather events, so I lose that data. What typically happens is that when
>>> the power comes back on, I get the dreaded "..page timestamp... less than
>>> final timestamp..." error. The only way I have been able to address it is
>>> to use the memory dump and clear.
>>>
>>>  I don't understand why this happens since the VP2 is running with
>>> battery backup, yet the memory on the datalogger gets corrupted. Is this an
>>> issue with weewx that could be addressed?
>>>
>>> Failing that, can I address this issue by adding a backup supply to my
>>> Pi Zero?
>>>
>>> Thanks!
>>>
>>> --
>>> 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 weewx-user+...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/weewx-user/c833a23b-2957-4311-882a-cda796d0c928n%40googlegroups.com
>>> 
>>> .
>>>
>> --
> 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 weewx-user+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/7bd3876d-96a1-4c3a-82fb-c4f406234066n%40googlegroups.com
> 
> .
>

-- 
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 weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAPq0zEAVVWPO5NdZJ6fhfaQpXxPxf7zTRv7ndQxYTFE5NE8dMw%40mail.gmail.com.


Re: [weewx-user] Davis VP2 reliability with Rasp Pi zero

2023-01-06 Thread storm...@gmail.com
Would also look at adding a DS1307 or DS3231 RTC Module to RPI zero. This 
should maintain the time when the RPI zero loses power.

On Friday, January 6, 2023 at 7:59:16 AM UTC-5 tke...@gmail.com wrote:

> If weewx causes the corruption, I sure don't see how. It operates well 
> within the published API provided by Davis. 
>
> Graham is probably right: a power spike from when power comes on is likely 
> the problem. It's coming through either the VP2 power supply or, more 
> likely, the Pi's. 
>
> Try at least a surge suppressor. A UPS would be even better.
>
> On Thu, Jan 5, 2023 at 5:46 PM iams...@gmail.com  
> wrote:
>
>> "What happens if you 'pull the plug' on your VP2? Does it keep running? 
>> Perhaps the batteries are bad?
>>
>> Yes, it keeps running, that is why it seems to be a weewx issue to me. In 
>> other words, if the Pi Zero running weewx were not connected to the VP2, 
>> the data logger memory would not get corrupted. In fact, weewx is able to 
>> recover data that was gathered during the power outage (while the Pi is 
>> shut down). It is only when power is *restored *that the data logger 
>> corruption happens. At least I assume that is really the root of the issue, 
>> I really don't know. All I know is that almost every time the power goes 
>> out, I get the record time error and all data recording and uploading stops.
>>
>> I've looked into getting a UPS for the Pi, which really appears to be 
>> nothing more than a $15 ext phone battery, but it seems to me this is a 
>> weewx problem that should be addressed. Alternately, I can contact Davis to 
>> see what they say.
>> "
>>
>> On Thursday, January 5, 2023 at 3:34:40 PM UTC-8 tke...@gmail.com wrote:
>>
>>> It should work.
>>>
>>> What happens if you 'pull the plug' on your VP2? Does it keep running? 
>>> Perhaps the batteries are bad?
>>>
>>> Personally, I use a UPS for both the weewx server and the VP2 and 
>>> haven't had a memory corruption problem in at least a decade. So, you could 
>>> try that.
>>>
>>>
>>>
>>>
>>> On Thu, Jan 5, 2023 at 11:30 AM iams...@gmail.com  
>>> wrote:
>>>
 I've been using weewx running on a Pi Zero with no other tasks. 
 Unfortunately, I live in a area that suffers power losses, often during a 
 weather events, so I lose that data. What typically happens is that when 
 the power comes back on, I get the dreaded "..page timestamp... less than 
 final timestamp..." error. The only way I have been able to address it is 
 to use the memory dump and clear.

  I don't understand why this happens since the VP2 is running with 
 battery backup, yet the memory on the datalogger gets corrupted. Is this 
 an 
 issue with weewx that could be addressed?

 Failing that, can I address this issue by adding a backup supply to my 
 Pi Zero?

 Thanks!

 -- 
 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 weewx-user+...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/weewx-user/c833a23b-2957-4311-882a-cda796d0c928n%40googlegroups.com
  
 
 .

>>> -- 
>> 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 weewx-user+...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/weewx-user/7bd3876d-96a1-4c3a-82fb-c4f406234066n%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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 weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/a9235658-a6dc-4ebd-b9ba-154cb1d5e8b7n%40googlegroups.com.


Re: [weewx-user] Re: weewx server?

2023-01-06 Thread 'Cameron D' via weewx-user
Are you saying that you have a registered domain name (and that is as far 
as you have gone), or that you have a web server that is already 
successfully serving other pages to the public internet? 
 What exactly is that raspberry pi doing?  If it is serving web pages, is 
it the same machine that is running weewx?

On Friday, 6 January 2023 at 6:35:21 pm UTC+10 kb3...@gmail.com wrote:

> Lots of info.  Thanks.  I  have a website domain already and use a 
> raspberry pi for this.  I apparently just can't seem to get it to show 
> other than on the local network.  
>
> On Thursday, January 5, 2023 at 12:13:20 PM UTC-5 pannetron wrote:
>
>> If you host a public website from a personal Linux server, as I do, look 
>> into using fail2ban as a way to detect and block some bad actor bots.  My 
>> implementation currently has about 2500 IPs blocked because they were 
>> looking for typical webserver security flaws.
>>
>> On Wednesday, January 4, 2023 at 11:11:49 AM UTC-7 do...@dougjenkins.com 
>> wrote:
>>
>>> Glad some of you find this useful.
>>>
>>> I have been using this method since it came out this summer (July 2022). 
>>> I run my infrastructure (Web Server, WeeWX, MQTT, MariaDB) as containers in 
>>> one stack in its own network all in Docker. I do this to limit what the 
>>> cloudflare tunnel can access on my network (just WeeWx stuff). All of this 
>>> works in docker in one stack and one YAML file!
>>>
>>> Like Tom Lawerence mentioned in the video I attached, you have to put 
>>> Cloudflare in your "circle of trust" as you are depending on them for both 
>>> the client and server/edge side of the tunnel. You have to make that 
>>> determination on your own if you are comfortable with that.
>>>
>>> As other methods mentioned here, they are all great alternatives. I was 
>>> not aware adafriut offered a dashboard to present your data. That can be a 
>>> good alternative than going through the hassle of hosting a full website 
>>> for your station.
>>>
>>> If I get a free moment in a few weeks, I can post a step-by-step article 
>>> on onboarding your WeeWX weather station as a public website using 
>>> Cloudflare. I think it can help a lot of users who struggle with the 
>>> network & security setup.
>>>
>>> DDJ
>>>
>>> On Wed, Jan 4, 2023 at 12:49 PM vince  wrote:
>>>
 On Tuesday, January 3, 2023 at 6:41:01 PM UTC-8 do...@dougjenkins.com 
 wrote:

> If you are willing to roll up your sleeves and get technical, serving 
> your website at home can be done safely and securely without changing 
> your 
> firewall. There are some steps to do, but at the end it will save you 
> money 
> and it will give you some real-world IT experience.
>
>
 Very cool - thanks for the pointer to the video.  I hadn't previously 
 figured out the Zero Trust terminology enough to try the tunnel stuff. 
 I'll 
 have to try the tunnel thing too 

 For the original poster, Doug's steps 1-3 are very easy.  I'd 
 previously done that using Google Domains ($12/year).

 Note - you probably still want to possibly harden your weewx webserver 
 a bit.  There are zillions of bots trying to attack web servers 
 'especially' all things WordPress.  If you go just with a vanilla weewx 
 setup you're likely in very good shape straight out of the box.  Cool 
 cheap 
 option for sure.

 -- 
 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 weewx-user+...@googlegroups.com.

>>> To view this discussion on the web visit 
 https://groups.google.com/d/msgid/weewx-user/56afd382-a9ba-49e7-831f-2813872d6db0n%40googlegroups.com
  
 
 .

>>>

-- 
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 weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/fdc5e744-6983-4527-a87d-38f0ff76793an%40googlegroups.com.


Re: [weewx-user] Davis VP2 reliability with Rasp Pi zero

2023-01-06 Thread vince
On Friday, January 6, 2023 at 4:59:16 AM UTC-8 Tom Keffer wrote:

> Graham is probably right: a power spike from when power comes on is likely 
> the problem. It's coming through either the VP2 power supply or, more 
> likely, the Pi's. 
>
> Try at least a surge suppressor.
>

We took a crazy set of multiple dips in a couple seconds in a windstorm a 
couple weeks ago, with perhaps four dips in two seconds.  The NUC stayed 
up. All my model-B and pi4 crashed but came back up ok. 

No corruption here on my VP2 connected to a pi4, with both connected to the 
same surge suppressor, but maybe I just got lucky in timing.  

-- 
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 weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/062d08d8-d4a8-4131-aa55-4ed9a3767a11n%40googlegroups.com.


Re: [weewx-user] Davis VP2 reliability with Rasp Pi zero

2023-01-06 Thread brisguy foo
Thanks all for the feedback! The engineer in me wants to debug this, but
assuming a UPS does the trick, probably best left alone. I do appreciate
all the effort put into weewx and since the interface is purely through the
api, seems like it must be a logger problem. I am going to take a look at
the Pi power supply though, just to see what it does on power cycle.

On Fri, Jan 6, 2023 at 4:17 AM Greg Troxel  wrote:

> "iams...@gmail.com"  writes:
>
> > I've looked into getting a UPS for the Pi, which really appears to be
> > nothing more than a $15 ext phone battery, but it seems to me this is a
> > weewx problem that should be addressed. Alternately, I can contact Davis
> to
> > see what they say.
> > "
>
> It seems, from long history, that if the computer that is polling the
> data logger goes away suddenly while interacting with the logger, the
> logger can get messed up.   This is arguably a bug in the logger.
>
> My advice, just like the advice you got from others, is get a UPS, which
> will also help avoid filesystem mess on the RPI0.
>
> If you want to trace what's on the serial and experiment and figure out
> what's going on, you certainly can.   But, pretty much everybody with
> the skills to do that believes in "you should get a UPS".
>

-- 
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 weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAJ-dst1yVMkWqdDGyi9pD8iic%3D6GkT2-26cr3LrRDu32Xdb4yQ%40mail.gmail.com.


[weewx-user] WS28xx USB pairing issue

2023-01-06 Thread jschoonh
I'm trying to make a new start but this time in the Netherlands.
Bought a WS 2818 and commissioned it without any problems.
A thin client t620 with a small linux mint that works fine and is connected 
to the internet.
But the USB dongle won't pair with the console.
Temporarily installed weewx on a laptop with the console right next to it. 
But with the same results.
The USB dongle is seen, the console shows "PC" after pressing "V".
What I don't understand why the frequency is changed from 86830 to 
910573909 ? could that be the problem?
Here below the printout of the laptop's terminal and part of the syslog.
Can anyone give me any suggestions?

 

sudo wee_device --pair

Using configuration file /etc/weewx/weewx.conf

Using WS28xx driver version 0.51 (weewx.drivers.ws28xx)

Pairing transceiver with console...

Press and hold the [v] key until "PC" appears (attempt 1 of 3)

Press and hold the [v] key until "PC" appears (attempt 2 of 3)

Press and hold the [v] key until "PC" appears (attempt 3 of 3)

Transceiver not paired to console.

Jan 6 21:40:36 jjs-SATELLITE-PRO-A50-C wee_device[84881] INFO 
weewx.drivers.ws28xx: driver version is 0.51

Jan 6 21:40:36 jjs-SATELLITE-PRO-A50-C wee_device[84881] INFO 
weewx.drivers.ws28xx: frequency is EU

Jan 6 21:40:36 jjs-SATELLITE-PRO-A50-C wee_device[84881] INFO 
weewx.drivers.ws28xx: found transceiver at bus= device=

Jan 6 21:40:36 jjs-SATELLITE-PRO-A50-C wee_device[84881] INFO 
weewx.drivers.ws28xx: manufacturer: b'LA CROSSE TECHNOLOGY'

Jan 6 21:40:36 jjs-SATELLITE-PRO-A50-C wee_device[84881] INFO 
weewx.drivers.ws28xx: product: b'Weather Direct Light Wireless Device'

Jan 6 21:40:36 jjs-SATELLITE-PRO-A50-C wee_device[84881] INFO 
weewx.drivers.ws28xx: interface: 0

Jan 6 21:40:36 jjs-SATELLITE-PRO-A50-C wee_device[84881] INFO 
weewx.drivers.ws28xx: base frequency: 86830

Jan 6 21:40:36 jjs-SATELLITE-PRO-A50-C wee_device[84881] INFO 
weewx.drivers.ws28xx: frequency correction: 95368 (0x17488)

Jan 6 21:40:36 jjs-SATELLITE-PRO-A50-C wee_device[84881] INFO 
weewx.drivers.ws28xx: adjusted frequency: 910573909 (0x36464155)

Jan 6 21:40:36 jjs-SATELLITE-PRO-A50-C wee_device[84881] INFO 
weewx.drivers.ws28xx: transceiver identifier: 256 (0x0100)

Jan 6 21:40:36 jjs-SATELLITE-PRO-A50-C wee_device[84881] INFO 
weewx.drivers.ws28xx: transceiver serial: 01022206180100

-- 
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 weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/5b1bb148-20c7-4fa8-999b-ba16f3166befn%40googlegroups.com.


[weewx-user] Re: Weewx Send data to Twitter Account

2023-01-06 Thread Jon B
I managed this by modifying Axelle's code above in process_record():

ts = time.localtime()
if ts.tm_hour not in (0,6,12,18) or ts.tm_min != 0:
logdbg("This is not hour to tweet: %d" % ts.tm_hour)
return

That should tweet at 00:00, 06:00, 12:00 and 18:00. I'm not sure if this 
will necessarily work if the archive interval is longer than 1 minute 
though (my station is set to 1 minute)
On Monday, 28 March 2022 at 21:00:45 UTC+1 arnaud...@gmail.com wrote:

> Hello, I installed the twitter extension 'weewx-twitter' on my install 
> (Debian 11 + WeeWX 4.7.0 + weewx-twitter 0.15) and it works fine. I 
> modified the 'twitter.py' file to post a tweet to my weather twitter 
> account and I wish the extension sends a tweet at a fixed time (0:00, 6:00, 
> 12:00, 18:00). But if WeeWX or the computer restarts, tweets are sent the 
> minutes the software starts (Ex: If WeeWX restarts at 4:12, the tweet is 
> sent at 6:12, then 12:12, 18:12).
>
> Here is my part of the file:
>
> ```ts = time.localtime()
> if (ts.tm_hour != 0 and ts.tm_hour != 6 and ts.tm_hour != 12 and 
> ts.tm_hour != 18):
>
> logdbg("This is not hour to tweet: %d" % ts.tm_hour)
> return
> ```
>

-- 
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 weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/0e2633af-992f-41df-abf1-a18533ab0b68n%40googlegroups.com.


[weewx-user] Re: Weewx Send data to Twitter Account

2023-01-06 Thread Jon B
Is it possible to use this to post the daily archived values for a given 
day? Ideally I'd like to set it to automatically tweet once a day (say at 
10am local time) giving the stats for the previous day, e.g.:

06/01/2023: Max temperature: 12.3C, Min temperature: 2.3C, Max wind gust: 
35 mph, Total rainfall: 12.2 mm

I have it working so that it only tweets once a day at 10am, but giving 
instantaneous values is a bit pointless at that tweet frequency
On Saturday, 7 January 2023 at 02:24:33 UTC Jon B wrote:

> I managed this by modifying Axelle's code above in process_record():
>
> ts = time.localtime()
> if ts.tm_hour not in (0,6,12,18) or ts.tm_min != 0:
>
> logdbg("This is not hour to tweet: %d" % ts.tm_hour)
> return
>
> That should tweet at 00:00, 06:00, 12:00 and 18:00. I'm not sure if this 
> will necessarily work if the archive interval is longer than 1 minute 
> though (my station is set to 1 minute)
> On Monday, 28 March 2022 at 21:00:45 UTC+1 arnaud...@gmail.com wrote:
>
>> Hello, I installed the twitter extension 'weewx-twitter' on my install 
>> (Debian 11 + WeeWX 4.7.0 + weewx-twitter 0.15) and it works fine. I 
>> modified the 'twitter.py' file to post a tweet to my weather twitter 
>> account and I wish the extension sends a tweet at a fixed time (0:00, 6:00, 
>> 12:00, 18:00). But if WeeWX or the computer restarts, tweets are sent 
>> the minutes the software starts (Ex: If WeeWX restarts at 4:12, the 
>> tweet is sent at 6:12, then 12:12, 18:12).
>>
>> Here is my part of the file:
>>
>> ```ts = time.localtime()
>> if (ts.tm_hour != 0 and ts.tm_hour != 6 and ts.tm_hour != 12 and 
>> ts.tm_hour != 18):
>>
>> logdbg("This is not hour to tweet: %d" % ts.tm_hour)
>> return
>> ```
>>
>

-- 
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 weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/2515fbd5-39db-494a-9fb1-34dafbec3a63n%40googlegroups.com.


[weewx-user] Re: Weewx Send data to Twitter Account

2023-01-06 Thread Jon B
 Is it possible to use this Twitter extension to post the daily archived 
values for a given day? Ideally I'd like to set it to automatically tweet 
once a day (say at 10am local time) giving the stats for the previous day, 
e.g.:

06/01/2023: Max temperature: 12.3C, Min temperature: 2.3C, Max wind gust: 
35 mph, Total rainfall: 12.2 mm

I have it working so that it only tweets once a day at 10am, but giving 
instantaneous values is a bit pointless at that tweet frequency


On Saturday, 7 January 2023 at 02:24:33 UTC Jon B wrote:

> I managed this by modifying Axelle's code above in process_record():
>
> ts = time.localtime()
> if ts.tm_hour not in (0,6,12,18) or ts.tm_min != 0:
>
> logdbg("This is not hour to tweet: %d" % ts.tm_hour)
> return
>
> That should tweet at 00:00, 06:00, 12:00 and 18:00. I'm not sure if this 
> will necessarily work if the archive interval is longer than 1 minute 
> though (my station is set to 1 minute)
> On Monday, 28 March 2022 at 21:00:45 UTC+1 arnaud...@gmail.com wrote:
>
>> Hello, I installed the twitter extension 'weewx-twitter' on my install 
>> (Debian 11 + WeeWX 4.7.0 + weewx-twitter 0.15) and it works fine. I 
>> modified the 'twitter.py' file to post a tweet to my weather twitter 
>> account and I wish the extension sends a tweet at a fixed time (0:00, 6:00, 
>> 12:00, 18:00). But if WeeWX or the computer restarts, tweets are sent 
>> the minutes the software starts (Ex: If WeeWX restarts at 4:12, the 
>> tweet is sent at 6:12, then 12:12, 18:12).
>>
>> Here is my part of the file:
>>
>> ```ts = time.localtime()
>> if (ts.tm_hour != 0 and ts.tm_hour != 6 and ts.tm_hour != 12 and 
>> ts.tm_hour != 18):
>>
>> logdbg("This is not hour to tweet: %d" % ts.tm_hour)
>> return
>> ```
>>
>

-- 
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 weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/3e721a07-d642-4836-b63d-9c9ee543d4c6n%40googlegroups.com.