Page 1 of 1
WLAN ESP8266 component on software uart?
Posted: Thu Aug 17, 2017 7:55 pm
by stefan.erni
Is it possible to use the Flowcode WLAN ESP8266 component on software uart?
It just shows me hardware uart pins.
Re: WLAN ESP8266 component on software uart?
Posted: Fri Aug 18, 2017 8:41 am
by LeighM
Hi,
There are a lot of data transactions on the UART, so we use hardware with interrupts and buffers,
hence software UART is not selectable, it would not work too well.
Re: WLAN ESP8266 component on software uart?
Posted: Fri Aug 18, 2017 9:42 am
by stefan.erni
Hi LeighM
ok. I understand.Unfortunately the board has only one uart and this is connected with the USB.
The ESP8266 is connected with "normal" pins and used only with 19200kB.
It's a board with a arduino nano and an esp8266 together.
I can program it with the rs232 component from FC7 with the AT command. It's working for simply commands.
But I would like the componete of FC7 to use.
Should I simply take another board?
http://duinorasp.hansotten.com/pretzelb ... rol-duino/
Re: WLAN ESP8266 component on software uart?
Posted: Fri Aug 18, 2017 10:27 am
by Benj
Hello,
It looks like a nice board but shame about the lack of a hardware UART to communicate with the ESP module. Using a software UART to talk with the ESP module will work but I can't see it being reliable. For instance if you are doing something when data starts to come in then you will essentially miss the data or receive corrupt data. This is not the case when you have a hardware UART and hence why we designed the Flowcode ESP component to only work with hardware UARTs. We also rely on the UART receive interrupt to populate our internal buffer so we don't have to continually poll for incoming data so moving away from this would be a significant change to the component.
If possible I would consider moving to another device with a hardware UART available for the ESP module.
I'll have a think on a software implementation but to me it just sounds like a bad idea. It may be possible to replace the UART receive interrupt with a pin change based interrupt so I will have a quick look into this for you.
Re: WLAN ESP8266 component on software uart?
Posted: Fri Aug 18, 2017 10:51 am
by stefan.erni
Hi Ben
Yes, I agree with you.
Your idea to give the software uart an interrupt, I think this is very good.
I already missed this in another project.
Would that be possible for FC7.3?
Re: WLAN ESP8266 component on software uart?
Posted: Fri Aug 18, 2017 12:15 pm
by Benj
Right I've done some mods to the component. I have not added anything new so I would only advise using this new component if you want the software UART option. I won't be including this in the updates release as its currently a bit hacky but hopefully should work and allow you to use your board.
First copy this component file into your "Flowcode 7/Components" folder. Maybe making a backup of the original file so you can go back if you need to.
Next here is an example project showing how the pin interrupt should work.
Let us know how you get on.
Re: WLAN ESP8266 component on software uart?
Posted: Fri Aug 18, 2017 2:06 pm
by stefan.erni
Hi Ben
I have tried but I can not set the ssid....
And I can not understand where I have to read the response from all the commands.
In your demo, you dont read a response.
Re: WLAN ESP8266 component on software uart?
Posted: Fri Aug 18, 2017 3:26 pm
by stefan.erni
Hi Ben
I use again the original componente esp8266 and I have tried on an another board.
https://shop.mikroe.com/clicker-pic32mx
https://shop.mikroe.com/wifi-3-click
It has five Uart and Uart5 is connected to the clickboard with an esp8266
But there is an error if I use uart5 (this is not if I compiele it with uart1)
***************************************************************************************************************** ^
C:\Program Files (x86)\Flowcode 7\CAL\PIC32BIT\PIC32BIT_CAL_UART.c:453:4: note: in expansion of macro 'MX_UART_INT_CH5_EN'
MX_UART_INT_CH5_EN;
^
C:\Program Files (x86)\Flowcode 7\CAL\PIC32BIT\PIC32BIT_CAL_UART.c:232:31: note: each undeclared identifier is reported only once for each function it appears in
#define MX_UART_INT_CH5_EN IEC5bits.U5RXIE = 1
Re: WLAN ESP8266 component on software uart?
Posted: Fri Aug 18, 2017 5:39 pm
by stefan.erni
Hi Ben
I still had an idea. I connected the clickboard wifi3 to the STM32F469i Disco. This board still has two uart free. All the worse, this error message surprised me......
Flowcode_stm32f469i_touchscreen_test.c: In function 'USART2_IRQHandler':
C:\Program Files (x86)\Flowcode 7\CAL\STARM\STARM_CAL_UART.c:124:57: error: 'MX_HANDLE_UART2' undeclared (first use in this function)
void USART2_IRQHandler(void) {HAL_UART_IRQHandler(&(MX_HANDLE_UART2)); HAL_UART_Receive_IT(&(MX_HANDLE_UART2), (uint8_t *)&(MX_HANDLE_UART2_RX_VAL), 1);} \
Re: WLAN ESP8266 component on software uart?
Posted: Fri Aug 18, 2017 10:32 pm
by LeighM
Thanks for the info, looks like Ben and I have some work to do on Monday

Re: WLAN ESP8266 component on software uart?
Posted: Mon Aug 21, 2017 12:47 pm
by LeighM
Hi,
Could you please drop this updated UART component into your /components directory.
This should fix the ST ARM issue.
What PIC32 chip were you using?
As that error looks like it could be an FCD issue.
Thanks
Leigh
Re: WLAN ESP8266 component on software uart?
Posted: Mon Aug 21, 2017 1:29 pm
by stefan.erni
Hi LeighM
Super Thank you
Yes the ST Board is working with the update.
On the Board is the
32-bit PIC32MX534F064H
more info under
https://shop.mikroe.com/clicker-pic32mx
Re: WLAN ESP8266 component on software uart?
Posted: Mon Aug 21, 2017 4:13 pm
by stefan.erni
Hi LeighM
With all these AT command test it would be easier if the USB interface could be used. Do you know if it's possible with the PIC 32 to use USB?
Re: WLAN ESP8266 component on software uart?
Posted: Mon Aug 21, 2017 4:16 pm
by Benj
Hello,
USB is not currently available on PIC32 but we are working on it. We have it working as of last week but we are currently trying to simplify and remove the requirement for the Harmony library as it's complicated to get it working at the moment.
I'll look into the compilation problem on the mentioned device and see if I can find the cause of the issue.
Re: WLAN ESP8266 component on software uart?
Posted: Mon Aug 21, 2017 5:28 pm
by Benj
I use again the original componente esp8266 and I have tried on an another board.
It has five Uart and Uart5 is connected to the clickboard with an esp8266
But there is an error if I use uart5 (this is not if I compiele it with uart1)
This should fix the PIC32 compile issue on UART channel 5.
Simply copy to your "Flowcode 7/CAL/PIC32" folder.
Let us know how you get on.
Re: WLAN ESP8266 component on software uart?
Posted: Tue Aug 22, 2017 3:14 pm
by stefan.erni
I am still busy with the STM32F469 board. I can now use the ESP8266 component. I init the component and afterwards I put the ESP8266 as an AP. that will not do. But if I change uart3 and uart6 and send the command with the UART, I can set the SSID.(cable, speed and hardware is OK)
Is there a possible to see what the ESP8266 componente responds?
The board has a touchscreen ...
If I check the "init" it's always in the Loop. If I dont check it .... it's not working
also. If I test the output(TX) from the esp8266 the osziloscope show me some signals.
Here the SC.
Re: WLAN ESP8266 component on software uart?
Posted: Wed Aug 23, 2017 9:11 am
by stefan.erni
Hi Ben
This should fix the PIC32 compile issue on UART channel 5
Yes it fixed the issue with the UART.
But unfortunately I can not change the SSID.
Re: WLAN ESP8266 component on software uart?
Posted: Wed Aug 23, 2017 9:27 am
by stefan.erni
It's working now with the STM32F469 Board
Sorry I did not see the option "command termination". I have to change it from '"\r " to "\r\n" for the modul I used.
https://www.sparkfun.com/products/13678
Re: WLAN ESP8266 component on software uart?
Posted: Thu Aug 24, 2017 3:02 pm
by stefan.erni
Hi LeighM
Now my STM32F469 with the ESP8266 works very well.
On the STM32F469 disco board, the USART6 is available twice.
Once on the "Arduino connector" and once on the ExtensionConnector
Can I switch this with flowcode alternatively?
Re: WLAN ESP8266 component on software uart?
Posted: Thu Aug 24, 2017 4:11 pm
by Benj
Can I switch this with flowcode alternatively?
Hmm, maybe, try adding two UART components to your project, both on Channel 6 but with different pin connections.
When you want to use the first connections initialise the first UART component and then use this to communicate.
When you want to use the second connections then initialise the second UART component and then use this.
Repeat as required.
Hopefully there will be no collisions in the low level C code but Leigh might know better.
Re: WLAN ESP8266 component on software uart?
Posted: Thu Aug 24, 2017 4:57 pm
by stefan.erni
Hi Ben
I would like to connect the ESP8266 at Pin C6 and C7.
But there is no possibility the pin remap or something like that.
At the ArduioneConnector I put a Datalogging plate.
Later I'll make a PCB board where the ESP8266 and the hardware from the datalogger are on one board. But for one version, the ESP always remains connected to the same pin. Maybe I do not know how to remaped the pins ...
Re: WLAN ESP8266 component on software uart?
Posted: Fri Aug 25, 2017 9:29 am
by LeighM
Hi,
I've updated and attached the FCD to give you access to pins on port C6 and C7
Just drop it into your Flowcode7\FCD\ARM directory
Leigh
Re: WLAN ESP8266 component on software uart?
Posted: Fri Aug 25, 2017 1:55 pm
by stefan.erni
Hi LeighM
Thank you. It's working nice.The advantage is also that the signals and powersupply are the same plug on the STM32 board.