Search found 22 matches

by LukeVideo
Tue Aug 06, 2019 7:46 am
Forum: ESP32 boards
Topic: adding a timeout to wifi connexion
Replies: 3
Views: 2253

Re: adding a timeout to wifi connexion

i added this to the connection routine

Code: Select all

    while station.isconnected() == False:
        presentTime = time.ticks_ms()
        duration = presentTime - startTime
        if duration > 5000:
            break
        pass
Works like a charm.
by LukeVideo
Tue Jul 30, 2019 2:43 pm
Forum: ESP32 boards
Topic: adding a timeout to wifi connexion
Replies: 3
Views: 2253

Re: adding a timeout to wifi connexion

That look like the way it's behaving.
I'll try that, thank you.
by LukeVideo
Tue Jul 30, 2019 1:05 pm
Forum: ESP32 boards
Topic: adding a timeout to wifi connexion
Replies: 3
Views: 2253

adding a timeout to wifi connexion

Hy, I'm using the sample from the documentation to connect my esp32 boards. def connect(): import network from utils.conf import ip, subnet, gateway, dns, ssid, password station = network.WLAN(network.STA_IF) if station.isconnected() == True: print("Already connected") return station.active(True) st...
by LukeVideo
Mon Jul 29, 2019 6:45 am
Forum: ESP32 boards
Topic: shift register bit shifting considerations [SOLVED]
Replies: 7
Views: 4098

Re: shift register bit shifting considerations

OMG, I'm so sorry... I found that it's a hardware issue. When i fix the board in it's case i squashed some soldering and made a short circuit. So the issue was also happening on the reset animation but so fast the untrained eye couldn't detect it. I feel bad for wasting your time but with no idea wh...
by LukeVideo
Fri Jul 12, 2019 7:37 am
Forum: ESP32 boards
Topic: shift register bit shifting considerations [SOLVED]
Replies: 7
Views: 4098

Re: shift register bit shifting considerations

Yes, this code is trash, But before optimizing it I wanted to know why it isn't consistent on the different devices and shift registers I have. How come reset_race and update_led always work and turn all leds on and off, but the idle_led doesn't always work but if it fails it's always on the same le...
by LukeVideo
Thu Jul 11, 2019 12:38 pm
Forum: ESP32 boards
Topic: shift register bit shifting considerations [SOLVED]
Replies: 7
Views: 4098

Re: shift register bit shifting considerations

I would prefer to keep the code as is as much as possible. My question really is on why the random output for the same function ?
Should i upload a new firmware ??
by LukeVideo
Thu Jul 11, 2019 8:00 am
Forum: ESP32 boards
Topic: shift register bit shifting considerations [SOLVED]
Replies: 7
Views: 4098

shift register bit shifting considerations [SOLVED]

Hello, I have these two functions that i use on different esp32 board with two SN74HC595N shift registers. def idle_led(i, data, clock, latch): global globalinterrupt_counter global total_interrupts_counter global reset_counter_val global led_count zeros = 16- i print(zeros) for e in range(zeros): c...
by LukeVideo
Wed Jun 12, 2019 8:54 pm
Forum: ESP32 boards
Topic: external interrupts consideration
Replies: 3
Views: 2479

Re: external interrupts consideration

Hy Peter, i have used the 3.3v outputs and added a 330ohm resistor to avoid any damage. I'm using the heltec lorawan V2 board https://heltec.org/project/wifi-lora-32/ the pin out diagram https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/blob/master/PinoutDiagram/WIFI_LoRa_32_V2.pdf So using two AD...
by LukeVideo
Wed Jun 12, 2019 9:04 am
Forum: ESP32 boards
Topic: external interrupts consideration
Replies: 3
Views: 2479

Re: external interrupts consideration

So i have modified the code a little to keep only one external import machine import json from machine import Pin from time import sleep from umqtt.simple import MQTTClient from utils.ConnectWifi import connect try: connect() except: print("no connectWifi") # shift register clock = Pin(17, Pin.OUT) ...
by LukeVideo
Tue Jun 11, 2019 8:59 pm
Forum: ESP32 boards
Topic: external interrupts consideration
Replies: 3
Views: 2479

external interrupts consideration

Hy, I was trying to add a second external interrupt to my code. I thought it might help me get out of the while loop. So tried to duplicate the way the first external interupt worked So i added And i had to comment the machine.disable_irq() and enable machine.enable_irq(state) or i had this terrible...