Search found 811 matches

by davef
Thu Jul 28, 2022 9:59 am
Forum: ESP32 boards
Topic: machine.WDT does not appear to work [Sorted]
Replies: 14
Views: 8645

Re: machine.WDT does not appear to work

wdt_singleton.py

Code: Select all

from machine import WDT

#  system WDT set for 10 seconds
wdt = WDT(timeout = 10000)


def feed_my_wdt():
    wdt.feed()
Still like to know why wdt.feed() needs to be treated like this.
by davef
Thu Jul 28, 2022 9:20 am
Forum: ESP32 boards
Topic: station.scan() issue on ESP32
Replies: 22
Views: 35597

Re: station.scan() issue on ESP32

I use mostly ESP32 DevKit C Wroom32U. The battery that is supplying both and USB dongles, describe it and how you are getting a clean 5V. When WiFi is messing-about you can get up to 0.5 Amp pulses of current, so if the regulator supplying your 5V is not strong enough then you can have problems. The...
by davef
Thu Jul 28, 2022 8:43 am
Forum: ESP32 boards
Topic: machine.WDT does not appear to work [Sorted]
Replies: 14
Views: 8645

Re: machine.WDT does not appear to work

OK, have read-up about module-level Singletons and think I can manage to create one to use. What I would like to know is why does the system watchdog call wdt.feed() work differently then using other library methods, ie import the library into various modules and call methods from it? Just a keyword...
by davef
Thu Jul 28, 2022 2:10 am
Forum: ESP32 boards
Topic: ESP-Now support for ESP32 (and ESP8266)
Replies: 368
Views: 1508585

Re: ESP-Now support for ESP32 (and ESP8266)

Glenn, That error means you forgot to do add_peer() before send() ;). When I first saw that I thought but I did add_peer() before the send and then a "penny-dropped". Because I never send messages from the repeater to the remote THAT peer was NOT added. I will repeat the test with add_peer(remote) b...
by davef
Thu Jul 28, 2022 12:03 am
Forum: ESP32 boards
Topic: machine.WDT does not appear to work [Sorted]
Replies: 14
Views: 8645

Re: machine.WDT does not appear to work

Thank you. I think I need to spend some time to actually understand this as I'd like to use wdt.feed() through-out my programs.
by davef
Wed Jul 27, 2022 8:45 pm
Forum: ESP32 boards
Topic: station.scan() issue on ESP32
Replies: 22
Views: 35597

Re: station.scan() issue on ESP32

I use two HUAWEI-E8231 USB dongles for my system. The issue I have is if I lose 5V to the dongles on re-power they need to be connected to a laptop to do the mode-switching, back to modem operation. It appears that you might not be seeing the same issue, but why are they hanging? In a marginal signa...
by davef
Wed Jul 27, 2022 8:57 am
Forum: ESP32 boards
Topic: socket settimeout problem.
Replies: 10
Views: 7535

Re: socket settimeout problem.

Had to have a bit of a search:
https://stackoverflow.com/questions/343 ... on-timeout
maybe setdefaulttimeout(2.0)
by davef
Wed Jul 27, 2022 8:10 am
Forum: ESP32 boards
Topic: socket settimeout problem.
Replies: 10
Views: 7535

Re: socket settimeout problem.

I have never connected to a socket.

The next line in my script is:

Code: Select all

sent = sock.sendto(send_data, server_address)
I guess if server_address ('192.168.8.8', 10000) wasn't really there I might find the settimeout didn't apply there as well.

Hope someone else has the correct answer for you.
by davef
Wed Jul 27, 2022 7:19 am
Forum: ESP32 boards
Topic: socket settimeout problem.
Replies: 10
Views: 7535

Re: socket settimeout problem.

Something to try:

Code: Select all

import usocket

sock = usocket.socket(usocket.AF_INET, usocket.SOCK_DGRAM)
send_data = b'I am going to listen for 5 seconds'
sock.settimeout(5) #  this sets the listening time
Works for me. Maybe try usocket then DGRAM might narrow the problem down.
by davef
Wed Jul 27, 2022 6:56 am
Forum: ESP32 boards
Topic: machine.WDT does not appear to work [Sorted]
Replies: 14
Views: 8645

Re: machine.WDT does not appear to work

like making it global
oops! I think you exposed a knowledge-gap. I have used global twice and didn't realise that it was needed in this context.
Thanks