Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 18:02
  • 12:18
    dsyleixa edited #6661
  • 12:17
    dsyleixa edited #6661
  • 12:17
    dsyleixa edited #6661
  • 12:16
    dsyleixa edited #6661
  • 12:15
    dsyleixa edited #6661
  • 12:11
    dsyleixa edited #6659
  • 12:11
    dsyleixa edited #6659
  • 12:09
    dsyleixa edited #6659
  • 12:06
    dsyleixa edited #6661
  • 12:05
    dsyleixa edited #6661
  • 11:56
    dsyleixa edited #6661
  • 11:55
    dsyleixa opened #6661
  • 11:46
  • 11:38
    dsyleixa edited #6659
  • 11:35
    dsyleixa edited #6659
  • 11:35
    dsyleixa edited #6659
  • 11:15
    johnm545 opened #6660
  • 11:02
    dsyleixa opened #6659
this is the power 3.3v supply
Stavros Korokithakis
@skorokithakis
What's the best and most reliable way for two ESP8266 to communicate over one or two wires (digitally), or, say, an ESP8266 with an Arduino?
Serial feels too complex
Michael Miller
@Makuna
@skorokithakis PJON is a one wire solution. There is always I2S.
Stavros Korokithakis
@skorokithakis
Is I2S? Is that like I2C?
PJON seems nice, thank you
It has error handling as well, that's great
Also, I'm making a thermostat that connects to MQTT, are interrupts a good way to handle the button inputs that change temperature without lagging? I've found that polling in loop() lags too much
Michael Miller
@Makuna
If polling in the loop has to much lag, then something in your code is eating too many cycles at one time (pretty common with the way Arduino is taught). You need to avoid using the delay() in your code with anything other than a single digit value.
The problem with button triggering actions on the interrupt is that many things can not be called from within an interrupt; so you will have to queue the input and then in the loop look for the input being present. This still is a good way as it makes the input detection more accurate; but doesn't solve any lag caused by slow loop code.
In my Task Library you will find some examples that show doing similar things. It might help to glance at that.
Stavros Korokithakis
@skorokithakis
Hmm, yeah. I just realized that I was going to do the processing in the loop too. I literally have nothing but an MQTT loop in the loop, and the button handling code
Maybe it's the debouncing lib, but at 20ms how laggy can it be?
Michael Miller
@Makuna
20ms is not noticeable by 99.99% of human population; only video gamers state they can feel it ;-)
Martin Ayotte
@martinayotte
:smile:
Stavros Korokithakis
@skorokithakis
Yeah, so that can't be it...
Victor Tseng
@Palatis
20ms... if it happens once every second you probably won't notice nothing
if it happens once every 40ms you definitely notice a lag.
Stavros Korokithakis
@skorokithakis
I'll test some more and see, thanks
Now I have a different problem, I need to drive two relays over one wire
So I'm thinking something that will connect the wire either to ground, or Vcc, or will leave it open
The first two are fine, but I'm not sure how I can just have a wire float without another relay
Martin Ayotte
@martinayotte
What do you mean by "two relays over one wire" ? Do you mean using OneWire protocol or the PJON mentioned above ?
Stavros Korokithakis
@skorokithakis
@martinayotte no, nothing like that, just an arrangement that would trigger one relay when the wire was grounded, another when it was connected to Vcc, and neither relay when it was floating
The schematic is two relays and two diodes, one to ground and one to Vcc, so when you ground the wire, current flows from Vcc to ground through one relay, when you connect it to Vcc current flows from Vcc to ground through the other relay
Aaron N.
@porkyneal
@skorokithakis Could you use a single relay, SPDT? So one circuit normaly open and one normally closed.
Stavros Korokithakis
@skorokithakis
@porkyneal no, because i need three states :/ it's for driving a motor forward and reverse, and stopping it
so i need two relays, one for direction and one to interrupt the flow of current
Ash
@ashthespy
Hey guys, what is the preferred way to clear the ESP's flash?
I have some ESP-12S modules that seem to already have some code on them.
ESP.getFlashChipRealSize() returns 1048576 bytes.
My compiled sketch is 250016 bytes. However, ESP.getFreeHeap() returns 45728 bytes. Am I wrong, or is there something already on the flash, and what would be the best way to clear it?
Martin Ayotte
@martinayotte
esptool.py --port /dev/ttyUSB0 erase_flash
BTW, ESP.getFreeHeap() returns RAM not Flash size.
Ash
@ashthespy
@martinayotte have I understood this correctly, I have a 4M flash (mega bit) i.e 1Megabyte correct?
so when I use the esptool (https://github.com/igrr/esptool-ck) I need to set the default flash size from 512K? Or just directly run --erase_flash ?
PS: thanks for the heads up about the FreeHeap, feel a bit foolish now! :worried:
Martin Ayotte
@martinayotte
@ashthespy , 4Mbits == 512Kbytes
esptool.py will send erase_flash cmd for whatever size, no need to specify it.
Butch Anton
@ButchAnton
@Palatis Mind if I ask you a quick question about RestClient?
brutzler
@brutzler
Thought a ESP-12E has 4 MByte Flash??
Stavros Korokithakis
@skorokithakis
@brutzler i think it does
well, i'm pretty sure it does
does anyone remember what that weird dev board with the RGB LED, photoresistor and buttons is called? @martinayotte
Ash
@ashthespy
Wiity :=-)
Stavros Korokithakis
@skorokithakis
ah, thanks
Ash
@ashthespy
Witty*
Stavros Korokithakis
@skorokithakis
brutzler
@brutzler
@skorokithakis just thinking why they dont pack them together on your link. Why the wiring?
Stavros Korokithakis
@skorokithakis
@brutzler the wiring was there already from the previous thermostat :/
Ash
@ashthespy
@brutzler I guess to use GPIO's while flashing/debugging?
Stavros Korokithakis
@skorokithakis
oh sorry
yeah, it's so the flasher isn't on the chip