ESP 8266 based components - comm injector simulation

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Post Reply
User avatar
Valued Contributor
Valued Contributor
Posts: 395
Joined: Thu May 06, 2010 11:42 am
Location: Sydney, Australia

ESP 8266 based components - comm injector simulation

Post by petesmart »

Hello fellow forum members,

I thought it might be useful for me to post a quick note to explain what all of the fuss was about in my previous posts on the ESP 8266 based components.

Some of you might know that Flowcode is a very powerful platform that can be used to create code using Flowcode 8 simulation tools. One particular useful simulation tool is the COM port injector. This injector allows you to communicate directly via the PC COM ports to a peripheral device for example an ESP 12S module real-time during simulation.

Currently I am working on developing MQTT protocol/interface for my Internet of things projects. Interfacing to third-party web-based Apis can be very tricky and time-consuming especially when you have to continually compile your code to target hardware. The reason that I'm using at present is a USB to RS 232 converter connected to a stand-alone ESP 12 S (ESP 8266) board. This mode of operation is really fast particularly when you're making changes to your code, all you have to do is to hit the simulation button and you can watch the communication and the variables change on the various data simulation and debug windows. You can even see the LCD or graphical displays update in simulation (real-time mode). This method of development provides a rapid debug process. Previously I have developed an interface to the Thinkspeak platform (HTTP get/put protocol). In a matter of a couple of hours I had a fully functioning interface from a MIAC to the web...

To use the COM injector function is really straightforward. When you load your target component for example ESP 12 S or BL 0136,
- click on the component in the 3D window
- find the simulation section on the properties window (see below)
- Select the simulation Data Source to COM port
- Select a COM port from the active list of comports - this will be the COM port that your USB to RS 232 device is connected to
- selection simulation method to COM/injector
- Select console data simulation to 'on'

now all you have to do is to hit simulate and watch the data flow to and from your device = use the Console to look at data flowing in the UART window, you can also see the circular buffer being updated... Apart from really tricky problems you don't need to use a logic analyser as the Flowcode 8 tools seem to be enough

For those of you who are into connecting your devices via RS 232 I strongly recommend this method of development as you can sort out a considerable amount of bugs and issues within your code before you hit the target hardware.

I'm also experimenting with USB to I2C and SPI simulation – will let everyone know how I go on this

Attached is a test program for those who are interested to play with..

All the best

(106.62 KiB) Downloaded 998 times
ESP12s testv1.fcfx
(17.49 KiB) Downloaded 96 times
sorry about that Chief!

Post Reply