Forum Hardware Others components Sync failed with ESP8266 and level shifter

Sync failed with ESP8266 and level shifter  [SOLVED]


Post Number:#1 Post Sun Oct 22, 2017 3:45 pm
Posts: 50
Topics: 13
Solve rating: 0
Joined: Wed Sep 06, 2017 7:45 pm
Topics: 13
Age: 40
Gender: None specified
National Flag:
Italy
Hi guys,

i fixed the overheating issue, i fixed another couple of big issues with the 7'' TFT, now I'm in troubles with the WIFI connection. I perfectly followed Fernando's indications. I did everything in the video here, step by step:

viewtopic.php?f=24&t=382&p=2943&hilit=wifi+5#p2943

The NodeMCU itself is well functioning because when it is connected to the USB cable "stand alone" this is what I can see in the Serial Monitor:

121> ** esp-link v3.0.14-g963ffbb
   121> Flash config restore ok
   121> CONN led=0
   121> SER led=14
   127> Wifi init, mode=AP+STA
   135> Wifi uses DHCP, hostname=esp-link
   146> "ip": "0.0.0.0"
   152> "netmask": "0.0.0.0"
   160> "gateway": "0.0.0.0"
   168> "hostname": "esp-link"
   176> sleep enable,type: 2
   184> Httpd init, conn=0x3fff3820
   194> No user file system found!
   203> Serbridge pins: reset=12 isp=13 swap=0
   242> Reset cause: 6=external
   242> exccause=0 epc1=0x0 epc2=0x0 epc3=0x0 excvaddr=0x0 depc=0x0
   242> Flash map 4MB:512/512, manuf 0xC8 chip 0x4016
   257> ** esp-link v3.0.14-g963ffbb: ready, heap=21368
   272> SNTP timesource set to us.pool.ntp.org with offset 0
   288> initializing MQTT
   295> MQTT_Init, host=ferduino.com
   305> initializing user application
   315> Waiting for work to do...
   324> mode : sta(5c:cf:7f:3d:5b:52) + softAP(5e:cf:7f:3d:5b:52)
   341> add if0
   346> add if1
   350> dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)
   372> bcn 100
   497> scandone
   498> state: 0 -> 2 (b0)
   532> state: 2 -> 3 (0)
   544> state: 3 -> 5 (10)
   544> add 0
   544> aid 7
   544> cnt
   557>
   557> connected with WebCube4-8EMQ, channel 8
   557> dhcp client start...
   560> Wifi connected to ssid WebCube4-8EMQ, ch 8
  3224> ip:192.168.1.110,mask:255.255.255.0,gw:192.168.1.1
  3224> Wifi got ip:192.168.1.110,mask:255.255.255.0,gw:192.168.1.1
  3232> host_name = esp-link
  3239> server_name = _http._tcp.local
  3250> MQTT: Connect to ferduino.com:1883 0x3fff8508 (client=0x3fff63e0)
  3279> MQTT: ip 104.131.49.99
  3280> MQTT: connecting...
  3586> MQTT: TCP connected to ferduino.com:1883
  3587> MQTT: Send type=TYPE_CONNECT id=0000 len=41
  3737> MQTT: Recv type=CONNACK id=0000 len=4; Pend type=NULL id=00
  3737> MQTT Client: Connected
 15184> Wifi check: mode=AP+STA status=5
 15185> Wifi got IP. Going into STA mode..
 15185> bcn 0
 15185> del if1
 15189> pm open,type:2 0
 15196> mode : sta(5c:cf:7f:3d:5b:52)
 15290> Turning OFF uart log



I prepare the circuit to connect the NodeMCU to Ferduino through the level shifter (exactly same components of your instructions!). I put name and ApiKey in the mqtt sketch, I loaded it and I connected the WIFI module. Unfortunately what i'm obtaining in the serial monitor is just this:

Setup...
Syncing or resyncing Arduino and ESP8266...
Sync failed!
Sync failed!
Sync failed!
Sync failed!
Sync failed!
Sync failed!
Sync failed!
Sync failed!



I really don't know why. I triple checked the circuit. I watched the video maybe ten times...but It seems everything all right to me. Any suggestion, at least in order to understand what is wrong?

thanks
Last edited by Fernando Garcia on Sun Oct 22, 2017 5:16 pm, edited 1 time in total.
Reason: Please use tags [code][/code] to post any code here.

Post Number:#2 Post Sun Oct 22, 2017 5:15 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

Hi!

This error can be related with baud rate.

In microcontroller console on ESP-Link make sure it's 38400 as you can see here:

Watch on youtube.com


Best regards.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#3 Post Sun Oct 22, 2017 5:35 pm
Posts: 50
Topics: 13
Solve rating: 0
Joined: Wed Sep 06, 2017 7:45 pm
Topics: 13
Age: 40
Gender: None specified
National Flag:
Italy
Just checked. It is 38400 everywhere.

this is present wiring for testing, if it can help.

Image


In addition I just noticed that when i connect the NodeMCU to a usb there is a blue led that blink in the upper side...when the NodeMCU is connected to Ferduino and I power it on there is no blinking...
Last edited by Fernando Garcia on Sun Oct 22, 2017 8:20 pm, edited 1 time in total.
Reason: Please use tags [img=left][/img] to post images

Post Number:#4 Post Sun Oct 22, 2017 8:44 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

I forgot to say, in Ferduino Mega serial 2 is used for stamps.

It should be conflict with multiplexer.

The solution should be use the SoftwareSerial library to create a virtual serial port using two free pins like 47 and 48 (when using PCF8575).

On test code add:

#include <SoftwareSerial.h>

SoftwareSerial virtualPort (47, 48);  // Rx, Tx


Change:

ELClient ESP8266(&Serial2);


To:

ELClient ESP8266(&virtualPort);


Change:

Serial2.begin(38400);


To:

virtualPort.begin(38400);


If it doesn't work try swap wire positions (rx and tx).
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#5 Post Tue Oct 24, 2017 4:06 pm
Posts: 50
Topics: 13
Solve rating: 0
Joined: Wed Sep 06, 2017 7:45 pm
Topics: 13
Age: 40
Gender: None specified
National Flag:
Italy
Hi guys,

I managed to have the Ferduino working. I tried to modify the mqtt sketch per your indications Fernando...but it didn't work. Then I struggled a lot. Finally i remove from the circuit the ground line from one side to the other of the level shifter (black bridge on your drawing)...and magically it works. but just with the default mqtt sketch, not with the modified one. After that I load the Ferduino code, uncommenting USE_ESP8266 and ETHERNET_SHIELD and it works very well.

My doubt now is: today i have not stamps connected (and so all the lines related are commented: USE_STAMP_FOR_TANK_PH, USE_STAMP_FOR_CALCIUM_REACTOR, USE_STAMP_FOR_ORP and USE_STAMP_FOR_DENSITY). Will I have issues when I will connect them, on the basis of your previous post?

thank you so much for everything.

Post Number:#6 Post Wed Oct 25, 2017 9:20 am
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

Hi!

I think it won't work in parallel.

Let me ask to Sueur Aurelien what he did.

Best regards.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#7 Post Wed Oct 25, 2017 11:29 am
Posts: 50
Topics: 13
Solve rating: 0
Joined: Wed Sep 06, 2017 7:45 pm
Topics: 13
Age: 40
Gender: None specified
National Flag:
Italy
Sure. Probably it will be usefull for also other users. Thanks.

Yesterday I let the system working on the table...after 6 Hours it stops again for overheating.
After the restart i plugged in the 3 temperature probes but were not detected neither with the dedicated function in Menu 2. I don’t want to go off topic but it can be related to this issue? What can i do to fix it and to have also probes working?

Post Number:#8 Post Wed Oct 25, 2017 4:21 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

This isn't a related issue.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#9 Post Wed Oct 25, 2017 6:20 pm
Posts: 50
Topics: 13
Solve rating: 0
Joined: Wed Sep 06, 2017 7:45 pm
Topics: 13
Age: 40
Gender: None specified
National Flag:
Italy
In order to help you in helping me :-c I try to give more pieces of information about the situation.
- Ferduino 100% original from Brazil (so difficult to find used here in Italy..it means that it works!);
- Ferduino with web control beta;
- Modifications in order to have the 7'' TFT working:
- bridge from 5V Arduino pin to 5V TFT PIN 18 per indication in this forum;
- trial of connection from 5V Arduino pin to 3.3V TFT PIN 19 with the 10 Ohms resistor without success...I don't know why;
- bridge between 3.3V TFT PIN 19 with the 3.3V TFT PIN 2 and it works;
- modification on code made by another user of the forum (I don't remember the name, sorry for that)
- active functions:
- ETHERNET_SHIELD
- USE_ESP8266
- DEBUG
- SKIP_PASSWORD_SCREEN
- USE_SCREENSAVER
- USE_TFT
- USE_PINS_18_AND_19_FOR_RTC
- anything attached at the moment (probes, sensors, relays)
- WIFI
- connected the ESP8266 with the level shifter per indication in this forum but it didn't work;
- removed the bridge between the 2 GND pins of the level shifter and it works but with a specific procedure that is the following
- Power on with everything connected
- WIFI doesn't work
- remove RX2 and TX2 connection
- reset the Ferduino
- reset the nodeMCU very quickly
- plug in the RX2 and TX2 connectors very quickly
- WIFI works!

obviously this is not a "robust procedure".
then i connected the temperature probes and they are not working, but if I will not be able to solve this issue by myself I'll open a dedicated post.

I hope that I'm not boring you. I would like to share in order to be helpful for somebody else, not just for being helped.

thank you very much.

Posts: 50
Topics: 13
Solve rating: 0
Joined: Wed Sep 06, 2017 7:45 pm
Topics: 13
Age: 40
Gender: None specified
National Flag:
Italy
I fixed some stuff.

Temperature probes were not working for physical connections issues. Now they are fine.

I was able to have the ESP8266 working with a virtual port using the library SoftwareSerial, as suggested by Fernando. Pay attention to some important things:
- I had to use a special version of the library that can be found searching for espSoftwareSerial;
- I had to use Arduino AVR Boards 1.6.10;
- I used pin A7 for TX and A8 for RX. Not all the pins on Arduino are ok to be used for RX!
- modifications on code are exactly the ones indicated by Fernando, just modifying the pin obviously;

So pin 16 and 17 will be used for stamps without issues i hope.

Now I'm struggling with the relay board, but i opened anther topic.

thanks.

Post Number:#11 Post Sun Oct 29, 2017 9:52 am
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

Hi!

Glad to hear!

Thanks for your feedback.

Best regards.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#12 Post Sat Mar 17, 2018 1:56 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

Notes:

Default SoftwareSerial library in Arduino IDE should be used for this purpose.

IDE downgrade is not needed

The changes above are not needed anymore.

The code was updated to make ESP8266 interface compatible with Ferduino Mega by default.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.




Return to Others components





Who is online

Users viewing this topic: No registered users and 1 guest

cron