These are chat archives for esp8266/Arduino

18th
Jun 2016
Martin Ayotte
@martinayotte
Jun 18 2016 00:32
@jetraid , during upload firmware to flash, baudrate can almost be any, the internal bootloader is doing baudrate autodetect. Then, running specific firmware, it is up to this firmware to determine required baudrate.
Mehrdad K
@mkeyno
Jun 18 2016 00:41
hi @martinayotte , do you have any idea what happened to my module
Martin Ayotte
@martinayotte
Jun 18 2016 00:44
@mkeyno , how do you power you ESP ? usually, strange errors like that is related to power supply. Otherwise, I've no idea.
Mehrdad K
@mkeyno
Jun 18 2016 00:50
I have no problem with other module with same power source
maybe is related to any disorder in flash addresses , caz it work for couple of first times , then errors come through
according to the error , module has not send designated respond didn't receive command response
but in upload files in SPIFF , it's work find and send back corrected command response
Martin Ayotte
@martinayotte
Jun 18 2016 00:58
If other modules work fine, then it is really possible that this particular module has a faulty Flash chip ... :-(
Mehrdad K
@mkeyno
Jun 18 2016 01:00
is there any way , for example format or erase to original
Martin Ayotte
@martinayotte
Jun 18 2016 01:03
Do you mean erasing the Flash ? yes, using esptool.py from madinventor, it has this option. But I don't think this will help curing a bad Flash chip.
Mehrdad K
@mkeyno
Jun 18 2016 01:04
is it possible upload the SPIFF and upload the sketch consume different power
Martin Ayotte
@martinayotte
Jun 18 2016 01:05
No, but maybe Flash working fine at specific address and start choking at different one.
Helio Machado
@0x2b3bfa0
Jun 18 2016 09:07
Hi! How can I use Wifi STA and Wifi softAP at the same time without blocking the program flow?
Clemens Kirchgatterer
@everslick
Jun 18 2016 11:17
@crushedice2000 you can have a look here: https://github.com/everslick/genesys/blob/master/net.cpp#L39-L142
Helio Machado
@0x2b3bfa0
Jun 18 2016 13:46
@everslick: I'm getting a crash when using STA and softAP
@igrr: I've seen this string on the ELF of a project that I'm compiling... Maybe the ESP8266Arduino framework has precompiled parts?
/Users/igrokhotkov/e/ESPTools/crosstool-NG/.build/src/gcc-4.8.2/libgcc/config/xtensa/lib1funcs.S
Clemens Kirchgatterer
@everslick
Jun 18 2016 15:36
@crushedice2000 can you be more specific? do you have a decoded stacktrace?
Helio Machado
@0x2b3bfa0
Jun 18 2016 15:42
@everslick: Yes:
0x40104199: ets_timer_disarm at ?? line ?
0x401044e6: spi_flash_read at ?? line ?
0x40201249: EspClass::flashRead(unsigned int, unsigned int*, unsigned int) at ?? line ?
0x4010676c: printf at ?? line ?
0x40208189: spiffs_phys_rd at ?? line ?
0x402059b0: spiffs_object_find_object_index_header_by_name_v at spiffs_nucleus.c line ?
0x402041b5: check_poison$part$0$constprop$4 at umm_malloc.c line ?
0x402042ba: check_poison_block at umm_malloc.c line ?
0x402043c7: check_poison_all_blocks at umm_malloc.c line ?
0x40204585: calloc at ?? line ?
0x401069bc: pvPortZalloc at ?? line ?
0x4021f441: wifi_station_set_hostname at ?? line ?
0x401044e6: spi_flash_read at ?? line ?
0x4021f529: wifi_softap_set_default_ssid at ?? line ?
0x4021f918: wifi_softap_get_config_default at ?? line ?
0x4021fa73: wifi_softap_set_station_info at ?? line ?
0x4021fb04: wifi_softap_get_station_info at ?? line ?
0x4021fb40: wifi_softap_get_station_info at ?? line ?
0x40205411: SPIFFS_stat at ?? line ?
0x40209d22: ESP8266WiFiSTAClass::begin(char const*, char const*, int, unsigned char const*, bool) at ?? line ?
0x40209c62: ESP8266WiFiSTAClass::begin(char const*, char const*, int, unsigned char const*, bool) at ?? line ?
0x40203738: SPIFFSImpl::_tryMount() at ?? line ?
0x40207372: spiffs_object_modify at ?? line ?
0x402074f8: spiffs_object_modify at ?? line ?
0x40202a04: pinMode at ?? line ?
0x40209daa: _GLOBAL__sub_I__ZN19ESP8266WiFiSTAClass12_useStaticIpE at ESP8266WiFiSTA.cpp line ?
0x4020abfb: DNSServer::replyWithIP() at ?? line ?
0x402014a8: HardwareSerial::read() at ?? line ?
0x40106974: vPortFree at ?? line ?
0x402285c8: tcp_write at ?? line ?
0x402285b3: tcp_write at ?? line ?
0x4020e9a7: AsyncStaticWebHandler::_getPath(AsyncWebServerRequest*) at ?? line ?
0x40214cfa: __udivmoddi4 at /Users/igrokhotkov/e/ESPTools/crosstool-NG/.build/src/gcc-4.8.2/libgcc/libgcc2.c line 964
:  (inlined by) __umoddi3 at /Users/igrokhotkov/e/ESPTools/crosstool-NG/.build/src/gcc-4.8.2/libgcc/libgcc2.c line 1168
0x402156ed: Stream::findUntil(char const*, unsigned int, char const*, unsigned int) at ?? line ?
0x40214cd0: __umoddi3 at /Users/igrokhotkov/e/ESPTools/crosstool-NG/.build/src/gcc-4.8.2/libgcc/libgcc2.c line 1165
0x40214c94: __fpclassifyd at ?? line ?
0x40201da4: loop_wrapper() at core_esp8266_main.cpp line ?
0x40204890: cont_norm at cont.o line ?
The affected code:
  WiFi.setAutoReconnect(true);
  WiFi.begin("MASKED", "FOR PRIVACY");

  WiFi.hostname("XXXXXXXXXXXXX");
  WiFi.softAPConfig(IPAddress(192, 168, 1, 1),
                    IPAddress(192, 168, 1, 1),
                    IPAddress(255, 255, 255, 0));
  WiFi.softAP(ESSID, PASS, CHANNEL, HIDDEN);
The code that seems to cause the problem (commenting it all works seamlessly):
WiFi.begin("MASKED", "FOR PRIVACY");
geman220
@geman220
Jun 18 2016 19:28
Is it possible to sleep the ESP but have it wake up from user input instead of timed intervals? I assume I wouldn't be able to send wifi commands though, so I'd have to attach some sort of sensor to the ESP?
I'm trying to get my ESP to be completely off the grid but I also need it to receive commands on the network. Most applications I see are having the ESP report data back to a server every X minutes. I need to be able to send commands to the ESP over the network.
Martin Ayotte
@martinayotte
Jun 18 2016 19:37
@crushedice2000 , I remember that more than a year ago, one of my router had space in the password and ESP wasn't able to connect. I removed the space and it worked. Maybe this still an issue with today's Espressif SDK ...
Michael Miller
@Makuna
Jun 18 2016 20:07
@geman220 It sounds like you are looking for a "Wake On Lan" feature, but I don't think WiFi has this support; as it needs to stay in communications with the wifi router to so that it is even connected.
geman220
@geman220
Jun 18 2016 20:08
@Makuna Do you have any suggestions on a battery / solar / programmatic combination to allow my Wemos to run indefinitely off grid?
Michael Miller
@Makuna
Jun 18 2016 20:08
And thus the timer, you wake, connect to wifi, poll for notifications, go back to sleep.
geman220
@geman220
Jun 18 2016 20:09
I've been trying to solve this for at least 4 months and I simply cannot get it to last any meaningful amount of time, let alone "forever". Currently I'm at my longest stretch of just about 48 hours, but it's going to die in the very near future.
The challenges are, I need to replicate this solution several times (10+) and the form factor needs to be relatively small. So I can't afford to get 30W panels for example, not only are they too expensive, but they are too big.
Michael Miller
@Makuna
Jun 18 2016 20:10
WiFi is not the lowest power solution for RF communications; there are others are better at power usage; but they all will require you wake and poll.
geman220
@geman220
Jun 18 2016 20:11
The problem with wake/poll is that the ESP is then looking to see if there is a command that's been issued at some interval in the past. I need it to be reactive to user input immediately.
Michael Miller
@Makuna
Jun 18 2016 20:12
But that means the radio has to be on all the time; which is your biggest power draw of any solution you go with. I am not sure what you want to do is feasible without larger power source.
But again, look at other radio technologies, there maybe one that fits this need.
geman220
@geman220
Jun 18 2016 20:13
I'm using a fairly large power source, 10,000mAh not a simple button cell or 10440 for example.
I guess I'll just have to look more into how to charge that battery with solar, I just simply cannot get it to work. I was hoping there was something I could do on the ESP to help lower the power consumption but it doesn't sound like there is. At least without changing radio tech
Michael Miller
@Makuna
Jun 18 2016 20:16
I don't understand the 48 hours then, I thought the Esp in idle with wifi was only 50mw, with peaks in the 200mw. How "active" is your subnet? Put them on there own WiFi router that has little network traffic?
geman220
@geman220
Jun 18 2016 20:17
From my findings it draws .13A max observed (usually .09A)
So .65W essentially
Michael Miller
@Makuna
Jun 18 2016 20:19
(sorry, I meant 50ma, 200ma) so it was close to what you were seeing.
geman220
@geman220
Jun 18 2016 20:21
The battery pack I have is one I had laying around for cell phones. So I can't easily verify the exact charge on the battery other than the indicator lights they have on the device. Either way it's on it's last "bar" of charge. Which means it will die in the relative future. I need to keep everything fairly compact, but I can get and plan on getting a fairly beefy sized battery. I'm looking at some 20,000mAh batteries now but I'm waiting to verify that they don't turn off with low current draw.
Michael Miller
@Makuna
Jun 18 2016 20:21
If you are only seeing 48 hours, then you have lots of traffic cause the esp radio to interact constantly (as 48 hours means peak of 200ma).
geman220
@geman220
Jun 18 2016 20:24
Would just putting them on their own subnet help that?
Michael Miller
@Makuna
Jun 18 2016 20:24
I am no expert on WiFi, but I would think they would have to be on their own SSID network, and that on its own subnet.
geman220
@geman220
Jun 18 2016 20:26
Do you know of any communities online that may be able to help with the solar aspect of this. I mean I could hook this up to a car battery and sure it'll run longer, but it will eventually die. The real goal is to have this run indefinitely
Michael Miller
@Makuna
Jun 18 2016 20:28
If you consume 200ma constantly, then your solar will need to supply 200ma constantly; since solar is only during day, and only during some peak time, and only when its sunny, your will need to have much larger solar support to guarantee it stays running.
Further, if you have two shade days in a row, then your battery reserve will be consumed.
geman220
@geman220
Jun 18 2016 20:31
But isn't 200ma @ 5V = 1W? The panel I have now was providing over 2W in direct sunlight. I guess that's why I'm confused.
Michael Miller
@Makuna
Jun 18 2016 20:33
Direct sunlight is only about fours a day on a sunny clear day; but you continue to consume that 24 hours a day. Your solar would need to be at least 6 times that and that still doesn't account for charge loss or poor weather.
(solar tracking helps extend but consumers power; still only increasing to about 10 hours)
panels off angle from sun are not as efficient, light filtered through atmosphere near the horizon is not as efficient.
geman220
@geman220
Jun 18 2016 20:36
So I need about 8W it sounds like?
Helio Machado
@0x2b3bfa0
Jun 18 2016 20:43
@martinayotte: No space. The password is a unsalted MD5 (yes, I'm a fan of the security holes)
Michael Miller
@Makuna
Jun 18 2016 20:47
@geman220 I suspect more than that, but if you look around the internet for "how much solar I needed" you will find calculators that should help.
geman220
@geman220
Jun 18 2016 20:47
okay, thanks
Hagai Shatz
@hagai-shatz
Jun 18 2016 21:10
For battery operated RF system I will not go with ESP8266 as the end devices, you might use one as a hub to communicate with end devices over 2.4GHz RF communication using low power transceivers like the Nordic Semiconductor nRF24L01+, they use 26 μA in standby mode and can wake up you MCU on incoming data. See this tutorial for exmaple. You can buy 10 under £5 in AliExpress, this leave you some budget to add MCU.
Me No Dev
@me-no-dev
Jun 18 2016 21:26
@hagai-shatz BTW we have been able to get some amazing run times from ESP based sensors
the trick is to run as a sensor only, so you wake up (wifi off) read the sensor and if that has changed, power up wifi and send the data then back to sleep
Hagai Shatz
@hagai-shatz
Jun 18 2016 21:28
Sure, you can put it to sleep and wake up to push the data, but this is not the design that was discussed above.
Me No Dev
@me-no-dev
Jun 18 2016 21:28
wake up can be done by the sleep timer or external falling interrupt
geman220
@geman220
Jun 18 2016 21:29
Right. I understand I could get pretty long run time in sensor only mode. And I may end up having to do that. But the original goal was to be able to send network based commands to the ESP to control a servo
Hagai Shatz
@hagai-shatz
Jun 18 2016 21:29
The requirements are for the end node to respond to user requests on demand.
geman220
@geman220
Jun 18 2016 21:29
Correct
@hagai-shatz I'm reading into what you've linked, thanks.
Me No Dev
@me-no-dev
Jun 18 2016 21:29
in that case some RF chgips might do slightly better (depending on output power and time of transmission)
but not all that nmuch if you need to listen for packets
RX required power is usually 80% of TX power, from what I have seen
therefore I split my devices in 3 groups: sensors, outputs, managers
outputs usually are powered externally, managing device also and sensors run on LiPOs
Hagai Shatz
@hagai-shatz
Jun 18 2016 21:33
nRF24L01+ can be in standby mode (26 μA) and wake up the system when receiving data, process it and go back to sleep if no action is required. Add an ATmega that in sleep mode most of the time and you can run for a very long time only from battery, add a solar panel and you are covered.
Me No Dev
@me-no-dev
Jun 18 2016 21:34
wakeup times and retransmission in those cases is a killer though
and I'm not positive you will be woken up on transmission in that mode on nRF
Hagai Shatz
@hagai-shatz
Jun 18 2016 21:35
You don't wake-up the MCU and you don't transmit if data is not for that specific address.
Me No Dev
@me-no-dev
Jun 18 2016 21:35
the mode you talk about will just wake up faster to be ready to RX or TX
I'll be really amazed if you are correct
that would mean I wasted a whole lot of power :)
Hagai Shatz
@hagai-shatz
Jun 18 2016 22:00
@me-no-dev You are correct, it will not listen in standby mode.
Still, it only consume about 12mA in active TX/RX mode, much less than ESP8266, and is can finish the pull for new commands cycle much faster than ESP. If the MCU wake up every second, wake up the transceiver and send a get-new-command packedge to the manager node, then receive the result command (or no command), there is still time for the MCU get back to sleep. The average power consumption should be lower than waking up the ESP every second to pull new commands.
However, this adds latency to the system.
Me No Dev
@me-no-dev
Jun 18 2016 22:09
the ESP does not consume much if WiFi is off ;)
though it requires more time to connect when switched on
but there are optione there as well
Hagai Shatz
@hagai-shatz
Jun 18 2016 22:10
What options?
Me No Dev
@me-no-dev
Jun 18 2016 22:10
3 types of wifi wakeup
with calibration, with partioal calibration(or something like it) and no calibration
then i fyou use static IP, you skip dhcp
if you know BSSID, that migh save some millis also
Hagai Shatz
@hagai-shatz
Jun 18 2016 22:12
Small correction regarding nRF24L01+: The transmitter on the controller can be setup with automatic retry, during this retry period the end devices can wake up to RX mode and if there is no data for them, go back to sleep. Ne need to TX to pull data.
Me No Dev
@me-no-dev
Jun 18 2016 22:13
so you need to retry until the device wakes up... yeah :D
Hagai Shatz
@hagai-shatz
Jun 18 2016 22:14
Only the controller that is also running the ESP constantly connected to WiFi and power.
Me No Dev
@me-no-dev
Jun 18 2016 22:15
?
Hagai Shatz
@hagai-shatz
Jun 18 2016 22:16
[WiFi Router] <---wifi---> [ESP & nRF24L01+ & Power supply] <---2.4GHz--->[ATmega & nRF24L01+ & battery]
When the ESP receive command to node B, it transmit a packet using nRF to node B address with retry, during this retry period the ATmega on node B will make up the nRF and will receive the packet. If the ESP did not receive ACK after the retry period then node B is down or out of range.