Search found 469 matches

by kevinkk525
Fri Oct 18, 2019 2:50 pm
Forum: ESP8266 boards
Topic: ntp time
Replies: 10
Views: 112

Re: ntp time

bellad wrote:
Fri Oct 18, 2019 2:21 pm
yes , we are friday = 5
utime.localtime()
(2019, 10, 18, 11, 21, 17, 4, 291)
Monday: 0
Tuesday: 1
Wednesday: 2
Thursday: 3
Friday: 4
...
by kevinkk525
Fri Oct 18, 2019 1:24 pm
Forum: ESP8266 boards
Topic: ntp time
Replies: 10
Views: 112

Re: ntp time

I wouldn't modify the weekday to stay compatible to the typical Python implementation but that's your choice..
by kevinkk525
Fri Oct 18, 2019 1:10 pm
Forum: ESP8266 boards
Topic: ntp time
Replies: 10
Views: 112

Re: ntp time

The weekday is consistent with the CPython3 output. I would have expected it to be 5 but apparently 4 is correct:
https://docs.python.org/3/library/time. ... truct_time

Monday is 0.
Being used to crontab I expected Sunday to be 0 but python thinks differently.
by kevinkk525
Fri Oct 18, 2019 9:47 am
Forum: ESP8266 boards
Topic: ntp time
Replies: 10
Views: 112

Re: ntp time

I use this:

Code: Select all

RTC_TIMEZONE_OFFSET=1
ntptime.settime()
tm = time.localtime()
tm = tm[0:3] + (0,) + (tm[3] + RTC_TIMEZONE_OFFSET,) + tm[4:6] + (0,)
machine.RTC().datetime(tm)
by kevinkk525
Fri Oct 18, 2019 7:32 am
Forum: Programs, Libraries and Tools
Topic: Show all opened sockets
Replies: 5
Views: 90

Re: Show all opened sockets

I have one esp8266 which ran since 5 weeks and one which ran since over 2 weeks. However no matter how close they are to the AP, they typically reconnect twice a day. So I consider the esp8266 rock-solid too. Making a resilient connection however isn't that easy as we have experienced and having mor...
by kevinkk525
Fri Oct 18, 2019 7:23 am
Forum: General Discussion and Questions
Topic: Modules with the leading "u" and without.
Replies: 7
Views: 155

Re: Modules with the leading "u" and without.

I agree with @pythoncoder, I'm not sure what to prefer here. Using "os" is the approach we are more used to when programming python but the functionality might be a lot smaller which you didn't expect. On the other hand we are programming microcontrollers and can expect that every module has a small...
by kevinkk525
Mon Oct 14, 2019 11:37 am
Forum: General Discussion and Questions
Topic: Micropython Education - Project proposals, ideas and help requested.
Replies: 11
Views: 277

Re: Micropython Education - Project proposals, ideas and help requested.

Downside is that this fork didn't get any updates in one year. Also many things are handled differently from the main micropython. I would stick to the official ports for educational purposes rather than explaining differences, forks, reasons for forks, etc.. That will probably only decrease the int...
by kevinkk525
Sun Oct 13, 2019 9:01 pm
Forum: Programs, Libraries and Tools
Topic: Cannot get Vagrant Up
Replies: 4
Views: 95

Re: Cannot get Vagrant Up

I'm using ubuntu 18.04 WSL on windows 10 and this is my script for setting up the repositories: #!/usr/bin/env bash sudo apt-get install make unrar-free autoconf automake libtool gcc g++ gperf \ flex bison texinfo gawk ncurses-dev libexpat-dev python-dev python python-serial \ sed git unzip bash hel...
by kevinkk525
Thu Oct 10, 2019 9:15 pm
Forum: ESP8266 boards
Topic: Door sensor with ESP8266
Replies: 3
Views: 118

Re: Door sensor with ESP8266

Glad you found the solution.
by kevinkk525
Wed Oct 09, 2019 8:32 pm
Forum: Programs, Libraries and Tools
Topic: umqtt get retained message
Replies: 6
Views: 122

Re: umqtt get retained message

As this method uses non-blocking sockets it is possible that it doesn't have any data available at the first execution. You call that method many times in a continous loop to keep receiving messages so it doesn't really matter if you receive it at the first call or the 2nd or 3rd.