Download the program for the device via the Internet.

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

Moderator: Benj

chipfryer27
Valued Contributor
Valued Contributor
Posts: 774
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 185 times
Been thanked: 204 times

Re: Download the program for the device via the Internet.

Post by chipfryer27 »

Hi

I'm a little busy for the next day or so but when I get a chance I'll send links to examples you can follow.

One quick question though, will the building have its own WiFi infrastructure (i.e. a router providing WiFi internet access throughout) or will the modules need to create their own point-to-point link?

Regards

gilanetugila
Posts: 268
Joined: Thu Jul 30, 2020 2:01 pm
Has thanked: 7 times
Been thanked: 1 time

Re: Download the program for the device via the Internet.

Post by gilanetugila »

Good evening! Happy Victory Day! Today I connected the expansion board for the esp8266-01 module (the module is inserted into this board and there is a place for soldering wires, suitable for "laboratory work") with the controller and indicator board. I would like to clarify with you what other preliminary actions or decisions need to be taken to start sending data from one module to another using a WI-FI channel.

gilanetugila
Posts: 268
Joined: Thu Jul 30, 2020 2:01 pm
Has thanked: 7 times
Been thanked: 1 time

Re: Download the program for the device via the Internet.

Post by gilanetugila »

Good evening! Most likely, two possibilities will need to be considered. One of them is when there is an access point in the form of a router, as now, and the second option is when there is no router and we will make point-to-point access.

viktor_au
Posts: 346
Joined: Fri Jan 26, 2018 12:30 pm
Location: South Australia
Has thanked: 44 times
Been thanked: 60 times
Contact:

Re: Download the program for the device via the Internet.

Post by viktor_au »

Hi gilanetugila
Re: Happy Victory Day!
Pls -- no politics and posts about war!!!

gilanetugila
Posts: 268
Joined: Thu Jul 30, 2020 2:01 pm
Has thanked: 7 times
Been thanked: 1 time

Re: Download the program for the device via the Internet.

Post by gilanetugila »

Good morning! I will be able to respond and do something about this project no earlier than 4 p.m. on Sunday.

chipfryer27
Valued Contributor
Valued Contributor
Posts: 774
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 185 times
Been thanked: 204 times

Re: Download the program for the device via the Internet.

Post by chipfryer27 »

Hi

I was a bit busy this week, catching up over the weekend.

As mentioned before, Flowcode interacts with the ESP8266 using the "AT" commands and you can monitor commands / responses using your USB-TTL Serial convertor (more on this later).

This also means you can use your PC to interact too, just by connecting the module to your PC. This allows you to send the same commands Flowcode would, and monitor replies.

Now that you have successfully updated the modules, which was the hardest part, they are now more or less able to communicate, you just need to tell them how. A little bit of configuration will have them passing data in no time. There are no complicated firmware interactions, you just send "AT" commands to configure and if you really screw up, a reset command usually gets you out of trouble.

It is worth noting though that you can mess things up (very unlikely). Usually because you have changed a setting and forgotten about it. If so and you really can't figure out why, then reflashing the firmware again will take you right back to default.

The modules can either talk to each other over their own generated network or via existing infrastructure such as your WiFi router and I'll send you some links later.

Regards

chipfryer27
Valued Contributor
Valued Contributor
Posts: 774
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 185 times
Been thanked: 204 times

Re: Download the program for the device via the Internet.

Post by chipfryer27 »

Hi

Have a read

https://www.flowcode.co.uk/forums/viewt ... 616#p10616

Although not your target chip, the principles are the same. In the posts two ESP8266 chips send data to each other in two ways. The first uses existing WiFi router, then they talk directly.

Regards

gilanetugila
Posts: 268
Joined: Thu Jul 30, 2020 2:01 pm
Has thanked: 7 times
Been thanked: 1 time

Re: Download the program for the device via the Internet.

Post by gilanetugila »

Good afternoon! Thanks for the link. Today I will take a look and try to do this on my components.

gilanetugila
Posts: 268
Joined: Thu Jul 30, 2020 2:01 pm
Has thanked: 7 times
Been thanked: 1 time

Re: Download the program for the device via the Internet.

Post by gilanetugila »

Good evening! I thought a little presumptuously that all this could be repeated in a few hours...I decided from the beginning to try to make a similarity of your programs, where there is a connection between two
esp8266 modules. I had to find out from the beginning what "OSCCON" is, then what 0xF0 is (this is the setting of the frequency register 11110000) and so on.

1)Please tell me why you use this register -is it similar to how the frequency is set in the program for avr controllers, and then the fuses are configured?

2) are the names and values of "SSID, Password" selected arbitrarily in the "ESP-ESP_AP_Tx" program in the "ConnectToSSID" block and they will be the same for the receiver and transmitter and are not related to the existing SSIDs around?

3)there in the program "ESP-ESP_AP_Tx" in the "ClientConnect" block, the IPAddress value should have the text format "0.0.0.0 to 255.255.255.255."? and where can I get it? 4) in the same block there is a variable Zport, you have it equal to 80.Is it possible that there is a connection to the computer?And if I only have a connection from module to module, there are no ports there? Do you have a module reboot cycle in your program? every 500 ms is it really a problem that there is no connection the first time or just in case?

gilanetugila
Posts: 268
Joined: Thu Jul 30, 2020 2:01 pm
Has thanked: 7 times
Been thanked: 1 time

Re: Download the program for the device via the Internet.

Post by gilanetugila »

Good evening! Sorry, there is another question: 1) there is a data transfer in the program "ESP-ESP_AP_Tx" in the "ESP_Send" subroutine-from the beginning you send a text command "attention, data transfer is about to take place" or "AT+CIPSEND="-why is there a "=" at the end, because the command without this sign? for what reasons is the value "SendCR " selected in bytes in all cases of sending commands in this subroutine? 2) then a text program is sent, a command indicating the length of the transmitted data "Len_Str"-can this be sent like "8" or made from the beginning as a byte variable, and then converted to text? for what reasons is its value chosen? 3) next comes the delay and sending of data, they can also be set immediately in text format or from the beginning a byte variable, which we convert to text. And if it is not known and enters the controller as it works, then most likely it definitely needs to convert the number to text.

gilanetugila
Posts: 268
Joined: Thu Jul 30, 2020 2:01 pm
Has thanked: 7 times
Been thanked: 1 time

Re: Download the program for the device via the Internet.

Post by gilanetugila »

Good evening! You have data reception in there in the program "ESP-ESP_AP_Tx"
in the subroutine "Get_Data", you write that the data needs to be converted to a text format, so they come to you in a text format? and the macro component itself is empty, there is nothing there and it is not marked in any way. There is only a text description of what it will do.

chipfryer27
Valued Contributor
Valued Contributor
Posts: 774
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 185 times
Been thanked: 204 times

Re: Download the program for the device via the Internet.

Post by chipfryer27 »

Hi

Sorry, I've no access to the actual files at present.

I used an internal oscillator for the PIC microcontroller. It has an inbuilt stable oscillator that can be selected. OSCCON is the register and 0xF0 would be the setting for the chosen speed. Each PIC may be different. Using the internal oscillator saves on external components.

SSID and Password are unique to your existing WiFi router. SSID is Service-Set Identifier and is your WiFi Network Name (which could be anything at all) and if you scan available WiFi networks with your phone (for example) you will see the names of all available networks in range. Password is the unique password needed to connect to the network. These may be printed on the rear of the Router or you may need to "login" to the router to obtain. However if you can connect to the network with your phone or PC then you already have the details (somewhere).

You will need to obtain these details and enter them in the FC chart so that the modules can join the network.

You need to tell the Tx module what you want to connect to, and this is the "target's" IP address in the format aaa.bbb.ccc.ddd (note if connecting to a hosted service on the internet you can use the web address such as www.abc.com). If on the same LAN you can get the target either by examining logs in the Router or getting the Rx module to display it's IP address.

Computers have thousands of available Ports for connection and many are controlled by international protocols. Port 80 is used for HTTP.

Not sure what you are referring to regarding rebooting every 500mS. Do remember the link I sent will have many charts in it, some by me, some by others and many may be work in progress. Send me the date and time of the post you are referring to.

Have you downloaded a copy of the AT commands yet?

Regards

gilanetugila
Posts: 268
Joined: Thu Jul 30, 2020 2:01 pm
Has thanked: 7 times
Been thanked: 1 time

Re: Download the program for the device via the Internet.

Post by gilanetugila »

Good afternoon! I'm sorry, maybe you misunderstood me or I didn't understand you. When information is transmitted from one esp-01 module to another of the same module without using an external router, do these esp-01 modules create a network among themselves and it can have any name or only the name of the network that the router creates?

I want to ask the same thing for ip address : when organizing communication only between two esp-01 modules, these addresses can be any or have an address template like a router's -let's say the address on the router is 222.24.75.12 and, accordingly, esp-01 modules should have addresses 222.24.75.13 and 222.24.75.14? and how do I find out the available numbers? and how to get them, because these numbers are usually not permanent, but change periodically (someone turned on a new device nearby, someone turned off and turned on the router and the address changed on it.)

I can somehow find out these addresses and network names without using a phone, but using some kind of program so that I can look at and select on a desktop computer.

As for the program for sending data over the network, I will take screenshots of the program a little later and mark them with a question and sign incomprehensible places, at the same time I will indicate the date of publication of the program.

Yes, I managed to download the "AT" control commands from various sources. They will be an attached file.
Attachments
AT_command.pdf
(811.43 KiB) Downloaded 76 times
at_command_set.pdf
(83.68 KiB) Downloaded 48 times

chipfryer27
Valued Contributor
Valued Contributor
Posts: 774
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 185 times
Been thanked: 204 times

Re: Download the program for the device via the Internet.

Post by chipfryer27 »

Hi

No access to FC / hardware at present.
Good afternoon! I'm sorry, maybe you misunderstood me or I didn't understand you. When information is transmitted from one esp-01 module to another of the same module without using an external router, do these esp-01 modules create a network among themselves and it can have any name or only the name of the network that the router creates?
If you are NOT using an external router and creating your own network using only the ESP8266 modules, you can call the SSID almost anything you like and set whatever password you wish. You would configure one esp as an Access Point (AP) with the others as clients. Each client would connect to the AP so they must all be in range of the AP.

When configuring the AP you can tell it to assign addresses to clients automatically (DHCP) or you can set them all as Static. The default IP of the modules is (I believe) 192.168.4.1 so if the AP had that and you used DHCP then each client would be assigned an available address such as 192.168.4.2 etc. You can of course change that to anything you wish (within reason) and / or use Static addresses.

If you use your PC and open a command window and type ipconfig then you will be given details of your connection. It will detail the PC address, subnet and Gateway. The Gateway is your router.

The AT commands document what each command does and how to use it. It is well worth reading up on common commands.

Regards

gilanetugila
Posts: 268
Joined: Thu Jul 30, 2020 2:01 pm
Has thanked: 7 times
Been thanked: 1 time

Re: Download the program for the device via the Internet.

Post by gilanetugila »

Good evening! Thank you very much for clarifying the questions you are interested in. It began to clear up a little. I keep going on.

chipfryer27
Valued Contributor
Valued Contributor
Posts: 774
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 185 times
Been thanked: 204 times

Re: Download the program for the device via the Internet.

Post by chipfryer27 »

Hi

The Wiki has some examples that are very helpful.

https://www.flowcode.co.uk/wiki/index.p ... (Wireless)

Regards

gilanetugila
Posts: 268
Joined: Thu Jul 30, 2020 2:01 pm
Has thanked: 7 times
Been thanked: 1 time

Re: Download the program for the device via the Internet.

Post by gilanetugila »

Good evening! Thanks for the link, I'll look at the examples tomorrow. I wanted to ask you about the lesson "ESP-ESP_Send" from March 15 , 2023. The questions are written in the screenshots of the program.
Attachments
Get_Data.JPG
Get_Data.JPG (114.43 KiB) Viewed 1836 times
ESP_Send.JPG
ESP_Send.JPG (152.09 KiB) Viewed 1836 times
ESP_Initialise_Setup.JPG
ESP_Initialise_Setup.JPG (85.65 KiB) Viewed 1836 times

chipfryer27
Valued Contributor
Valued Contributor
Posts: 774
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 185 times
Been thanked: 204 times

Re: Download the program for the device via the Internet.

Post by chipfryer27 »

Hi

You posted three screenshots.

One
The "empty" macro you refer to is just an example. You would instead add whatever macros you need to gather whatever data you desire.

Two
We are using AT commands to control the esp8266.

If you refer to the AT Commands and look at CIPSEND you will find out how it is used. Also check up on how servers communicate.

Briefly, when we send information out to a server we need to tell it we are about to send something, its length, then the actual thing we are sending.
The charts you refer to are simplistic in an attempt to illustrate the process. We need to construct a string that contains the command and then the length of the data the server is to receive.

The first send string sends out part of the complete string we need, however we do not terminate it with \r\n.
The second send string sends the actual length of what we are about to send.
The server accepts this and responds with ">"
We wait a short delay for the server to respond with the ">" then we send the actual data.

Three
This branch attempts to connect to the esp8266 that is acting as the receiver (in this particular application), or target if you prefer. If it does not successfully connect then we do a RESET and start the chart from the beginning.

Regards

gilanetugila
Posts: 268
Joined: Thu Jul 30, 2020 2:01 pm
Has thanked: 7 times
Been thanked: 1 time

Re: Download the program for the device via the Internet.

Post by gilanetugila »

Good morning! Thanks for the clarification, but the answers are not to the point of the questions asked. I have now tried the command "AT+CIPSEND=" (as in your program), send it from the esp-01 module connected to a USB-TTL adapter, using terminal programs, I thought it would give me the length parameters, but writes that the format is incorrect.
Attachments
AT+CIPSEND=.JPG
AT+CIPSEND=.JPG (36.06 KiB) Viewed 1816 times

chipfryer27
Valued Contributor
Valued Contributor
Posts: 774
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 185 times
Been thanked: 204 times

Re: Download the program for the device via the Internet.

Post by chipfryer27 »

Hi

If you reread my answer (# Two) you will see that I inform of what a server expects and what we need to do to achieve this.

Only sending part of the required string is very unlikely to achieve results and hitting the enter key before you have sent the entire command will cause the esp to attempt to process what you have already typed.........

If you are (which is a good way to learn) using AT from a Terminal you will need to do some manual calculations first.

If you wish to send Hello you may think this is five characters in length, but not to a server. You need to include everything being sent in the string such as termination characters ( \r\n ) which adds another four to the length.

If you look in the chart, especially the calculations, you will see how the strings are constructed, then you will see once constructed we calculate the length.

For example sending Hello\r\n is nine characters

Using Terminal, you would issue the AT+CIPSEND=9 then enter. After a few milliseconds the esp will reply with a ">"
You can now type in Hello and press enter (which will add \r\n)

If you don't first tell the esp how many characters to expect, or send the incorrect value you are unlikely to have much success.

Regards

gilanetugila
Posts: 268
Joined: Thu Jul 30, 2020 2:01 pm
Has thanked: 7 times
Been thanked: 1 time

Re: Download the program for the device via the Internet.

Post by gilanetugila »

Good afternoon! Thanks for the clarification. I just thought it works like in a computer (I've been doing it for so long that I don't remember how), when you send a command, and the answer comes how it should look (characters, spaces, dashes, and the like.)

chipfryer27
Valued Contributor
Valued Contributor
Posts: 774
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 185 times
Been thanked: 204 times

Re: Download the program for the device via the Internet.

Post by chipfryer27 »

Hi

Very easy to overlook when a "PC" is taking care of everything as you don't get to see what is going on behind the scenes. Not so with a uC though :)

Regards

gilanetugila
Posts: 268
Joined: Thu Jul 30, 2020 2:01 pm
Has thanked: 7 times
Been thanked: 1 time

Re: Download the program for the device via the Internet.

Post by gilanetugila »

Good evening! I looked at this web page with different examples. I started with the first example. There is its own layout board and the task is to get the firmware version and display it on the screen. I launched that program from "help", called "Firmware Test". Well, I don't know if it should work correctly, but apart from the inscription "Init, FW" I didn't see anything. I did the same thing. I did not see the firmware version, but I found out that you can display text on the LCD display without selecting a line and moving the cursor! it's a small thing, but the program will weigh less.

In addition, it is not entirely clear when the esp 8266 module sends and receives commands and data over the uart channel and when over wi-fi !? Remember when we connected the controllers via the uart bus, we gave the command to send in one program and receive data in the other. And in the help program, just get data (send) from the esp-01 module, and it's not clear to get it over wi-fi or the uart bus? but even then, not everything was sent from the esp-01 module, but the commands to accept this data by the controller were not...
Attachments
Atmega8_ESP-01_FirmwareTest.fcfx
(14.08 KiB) Downloaded 67 times

chipfryer27
Valued Contributor
Valued Contributor
Posts: 774
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 185 times
Been thanked: 204 times

Re: Download the program for the device via the Internet.

Post by chipfryer27 »

Hi

I still have little access to hardware or Flowcode, so...
I looked at this web page with different examples.
Which website?

First thing to check is settings, especially connections if you have altered anything from the example you mention.
it is not entirely clear when the esp 8266 module sends and receives commands and data over the uart channel and when over wi-fi
Not sure I know what you mean. I'm guessing you have used the ESP8266 component so the Tx/Rx of the actual module will connect to the pins specified in the component. Any macro component will then communicate with the module over these pins. If you tell it to "connect", the command is sent out over the pins and the module will then attempt to "connect" via the wireless connection to whatever.

Regards

chipfryer27
Valued Contributor
Valued Contributor
Posts: 774
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 185 times
Been thanked: 204 times

Re: Download the program for the device via the Internet.

Post by chipfryer27 »

Hi

Looking at your chart.

You are using an ATMEGA and have an LCD, ESP8266 and a UART component added which shares the same connections as the ESP. This is problematic and I'm unsure why you need the UART at all. If you remove this and check other connections/settings you should get some reply.

However after you print Firmware Test you should move the cursor to the next line (1) before printing data

Regards

Post Reply