WLAN ESP8266 component on software uart?
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
- Contact:
WLAN ESP8266 component on software uart?
Is it possible to use the Flowcode WLAN ESP8266 component on software uart?
It just shows me hardware uart pins.
It just shows me hardware uart pins.
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
- Contact:
Re: WLAN ESP8266 component on software uart?
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.
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.
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
- Contact:
Re: WLAN ESP8266 component on software uart?
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/
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/
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: WLAN ESP8266 component on software uart?
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
- Contact:
Re: WLAN ESP8266 component on software uart?
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?
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?
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: WLAN ESP8266 component on software uart?
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
- Contact:
Re: WLAN ESP8266 component on software uart?
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.
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.
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
- Contact:
Re: WLAN ESP8266 component on software uart?
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
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
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
- Contact:
Re: WLAN ESP8266 component on software uart?
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);} \
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);} \
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
- Contact:
Re: WLAN ESP8266 component on software uart?
Thanks for the info, looks like Ben and I have some work to do on Monday
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
- Contact:
Re: WLAN ESP8266 component on software uart?
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
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
- Attachments
-
- cal_uart.fcpx
- (11.07 KiB) Downloaded 227 times
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
- Contact:
Re: WLAN ESP8266 component on software uart?
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
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
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
- Contact:
Re: WLAN ESP8266 component on software uart?
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?
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?
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: WLAN ESP8266 component on software uart?
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: WLAN ESP8266 component on software uart?
This should fix the PIC32 compile issue on UART channel 5.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)
Simply copy to your "Flowcode 7/CAL/PIC32" folder.
Let us know how you get on.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
- Contact:
Re: WLAN ESP8266 component on software uart?
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.
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.
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
- Contact:
Re: WLAN ESP8266 component on software uart?
Hi Ben
But unfortunately I can not change the SSID.
Yes it fixed the issue with the UART.This should fix the PIC32 compile issue on UART channel 5
But unfortunately I can not change the SSID.
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
- Contact:
Re: WLAN ESP8266 component on software uart?
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
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
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
- Contact:
Re: WLAN ESP8266 component on software uart?
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?
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?
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: WLAN ESP8266 component on software uart?
Hmm, maybe, try adding two UART components to your project, both on Channel 6 but with different pin connections.Can I switch this with flowcode alternatively?
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
- Contact:
Re: WLAN ESP8266 component on software uart?
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 ...
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 ...
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
- Contact:
Re: WLAN ESP8266 component on software uart?
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
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
- Attachments
-
- 32F469Discovery.fcdx
- (33.9 KiB) Downloaded 134 times
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
- Contact:
Re: WLAN ESP8266 component on software uart?
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.
Thank you. It's working nice.The advantage is also that the signals and powersupply are the same plug on the STM32 board.