Monday, June 5, 2017

Espressif Wifi not connecting or showing AP

Leave a Comment

First of all, I won't go into details, cause there are a lot of them, and I dont want to write (a too long) essay. There is TL;DR section at the end, because I have a specific question, but maybe some additional info can help.

I have a device that is made of a GRU (glass room unit) and espressif (esp8266).

GRU and esp8266 communicate via serial, with GRU as master. GRU is programmed with an internal tool, and I can monitor everything on it, including the info it gets from esp8266. There is a test/development device, that has espressif on top of the GRU, so I can easily take it off, reprogram/reconfigure it, and put it on.

Espressif is inside of a GRU, and downloading stuff to flash is a real pain. There is whole process including a OS switch (from Win7 to Linux and back). Console output on espressif cannot be done, or at least not in the time frame I have.

For esp8266 I use non-os SDK V2.0.0_16_08_10.

Espressif can be configured with downloading a configuration to flash, or via UDP (over a network if connected, over its AP if its not connected).

Algorithm for Wifi:

 1. Try to connect to a network from configuration  2. If it succeeds, raise a flag for that  3. If it fails, enter dual (STATION+AP) mode and raise a flag for that 

The reason espressif is not always in dual mode is that it affects multi-cast operations.

Configuration over network is done by a Java aplication I wrote.

Scenario 1

I've configured a wifi router, configured all (x19) of the devices (espressif in devices that is) to connect to its network. When I turned them on, they would connect one by one. The ones that didn't entered dual mode and could be configured via the app.

All well.

Scenario 2 I've wanted to test the system in real world, so I reconfigured them to connect to the our firms network. Additionally when I was already going thru the whole process I've downloaded latest firmare to flash.

I expected that they would connect or enter dual mode and create their own APs. But they did not.

I tested then the code and configuration on espressif whose console output I could monitor, and everything worked.

I tested then the code and configuration on the test device, and it worked again.

I've then redownloaded the code and configuration to one device, and it didn't work.

TL;DR I have two devices, espressif on a GRU and espressif inside of a GRU. Both connected to one network. Esp on a GRU work for another, Esp inside of a GRU doesn't work for that other network. They have identical code and configuration, so it shouldn't be a software issue.

Does having espressif inside of a device jams its signal enough that it can't go trough? Device is not big (5x5x2cm).

UPDATE 1: While I was writing, the espressif inside of a GRU managed to connect to network. I then restarted it so I can check that it can do it again, and it can't connect again. It took me about 10 minutes to write the whole question.

1 Answers

Answers 1

There are two things that seem to have caused the problem.

When I removed gpio_init(), network stuff became faster, much much faster. Everything on it, connecting to AP, creating AP etc...

I've changed my config and wifi code, so that it now stores the ap and station config to flash via API.

I only check if its internal config is the same as mine from flash. If it isn't, it saves it. Now, I only control the current opmode.

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment