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: 773
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 185 times
Been thanked: 204 times
Contact:

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

Post by chipfryer27 »

Hi

That's interesting.

I did find a few issues with the component which I documented in other posts (new and old forum). One being when issuing ClientConnect the component returns a 0 even if successfully connected. This is attributed to espressif / clones / whomever changing firmware after the component was created. If successful the esp returns "OK" but the component is looking for "Connected" (or vise-versa). Kersing kindly modified the component so that I can preset the expected reply.

I think there was another glitch in that the component macro didn't work but if you used SendString with the relevant AT then you could work around. I'd need to check back. Any glitches did seem related to not getting the expected reply though, so I'm attributing to the firmware not returning what FC expects.

None of this relates to the issues he's facing though.

Regards

mnf
Valued Contributor
Valued Contributor
Posts: 1200
Joined: Wed May 31, 2017 11:57 am
Has thanked: 70 times
Been thanked: 440 times
Contact:

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

Post by mnf »

A step forward...

I managed to reflash the Wemos d1 mini.

I managed to get the device to reply with the firmware version using an FTDI device.

But - I think the problem is that the ATMega8 at least won't support the display (I tried an ssd1306 and set the display height to 16). I think it might be a RAM issue rather than a component conflict - it only has 1K.

So - to get the reply - I attached an FTDI device Rxd to d0 (and to Tx on the esp8266)
I also attached ground - and because my FTDI device needs it VCC (3.3V) (most don't - the one I use matches voltage)

I also attached D1 to Rx on the esp8266

This gave using GetFirmwareVersion
AT+GMR
AT version:1.7.5.0(Oct 9 2021 09:26:04)
SDK version:3.0.5(b29dcd3)
compile time:Oct 15 2021 18:05:38
Bin version(Wroom 02):1.7.5
OK
Hooray.

I think removing the HTML source - might make more space - will test that and see if it allows the display to run too..

Martin

mnf
Valued Contributor
Valued Contributor
Posts: 1200
Joined: Wed May 31, 2017 11:57 am
Has thanked: 70 times
Been thanked: 440 times
Contact:

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

Post by mnf »

Tested with the WLAN component cut down to a minimum - no web pages, no substitutions.

Adding an SSD1306 (height set as 8 ) - and the esp8266 just returns 'error'.

Two UARTs also seems to be too much - I tested using a 32 byte string to hold (some of) the firmware version - and used 4800baud (9600 - "hello" got corrupted) - but the string output is 'gibberish'

I think moving to a m328p or better is the order of the day!

Martin

mnf
Valued Contributor
Valued Contributor
Posts: 1200
Joined: Wed May 31, 2017 11:57 am
Has thanked: 70 times
Been thanked: 440 times
Contact:

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

Post by mnf »

Looking at the component source - and it it makes fairly heavy use of RAM.

For example 6 'In' and 10 'Out' buffers of 20 bytes each and ScanNames at 100 bytes.

Some might be optimised away by the compiler (?).

It might be possible to modify it to a 'cut down' version - with less features and less memory use - for example using a UART and sending 'AT' commands to connect and then send data.

Also - using a string that is too small for GetFirmwareVersion - will causes issues - it doesn't check that the string is large enough to hold the returned data.

I didn't manage to get the chip to output the firmware string to a software UART. Whether this is because it isn't received correctly or the transmission is messed up - I'm not sure..

Martin

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

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

Post by chipfryer27 »

Hi Martin

Thanks for doing those tests which really are helpful. I hadn't even started to think on the "receive", waiting until it could transmit, so your finding are very useful especially as I have no experience with this chip.

I too think given all of the above that his best course of action in the long run is to use a 328P, and as that is a "free" chip in FCv10 to upgrade to FCv10 too (which is free).

Regards

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

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

Post by gilanetugila »

Good afternoon! I have now conducted an experiment based on your recommendation: I removed the uart module from the program, disconnected the esp-01 module from the board, the program text is LED flashing, and the letter "U" is sent inside. The program was running, the LED was blinking. In the attached drawings, the LED flashes in yellow, and the letter "U" is sent in green. But sending the letter "U" by signal looks like sending the letter "U" by the uart module-several identical pulses.

Respected "chipfryer27", you sent me the file "Test connections.pdf" so that I could check your offers on the board using atmega 8-is this offer valid? and what to do next on atmega 328p-?
Attachments
Atmega328p_flash_led_test_send_U.fcfx
(11.49 KiB) Downloaded 13 times
dso_01_01_00_07_48.jpg
dso_01_01_00_07_48.jpg (61.57 KiB) Viewed 1153 times
dso_01_01_00_10_48.jpg
dso_01_01_00_10_48.jpg (60.81 KiB) Viewed 1153 times

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

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

Post by chipfryer27 »

Hi

It's good news that you now have the chip working as expected, and yes, the test diagrams I sent work for all chips, not just the Mega8.

A big thanks to Martin for taking the trouble to set up and test with a Mega8 and establishing the limitations of using it.

The tests were to help establish what was going wrong, but as you now can send only using the esp component then you can just "keep them in your pocket" if you have further trouble.

Having the USB-TTL adapter connected to your PC (running Terminal at correct baud) with a "jumper wire" from it's Rx going to wherever, is a great way to monitor whatever your chip is sending or receiving.

I'd suggest you get some practise with that. Perhaps connect to your chip Tx and send the "U" and see if you can receive it in your PC, then perhaps create another test string and see if you can capture that too.

Being able to monitor as I describe is a great way to ensure things are being sent / received correctly and learn about sending and receiving data.

You should receive the following if connected to Terminal as every second another U will be added (example shows after four seconds)

UUUU

If you then change FC to send "U\r\n" instead of "U" then you would receive the following (again after fours seconds)

U
U
U
U

The difference is we now send Control Characters too, which tell the receiving program to return to the beginning of the line and move to the next line. This combination of control characters are very important as many devices will only act on the data when these are received. As Martin mentioned above these hark back to the days of "Teletype" and are still in use today as "if it ain't broke don't fix it" :)

Regards

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

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

Post by gilanetugila »

Good evening ! Today I will try to add a usb-ttl adapter to the test and read it using the terminal program. Do I need to insert an esp-01 into this module, or do I need to connect the wire from my controller to the Tx pin to the Rx pin of the usb-ttl adapter? and do I still need to connect the "-" adapter to the "-" of my board, where the controller is connected? The signal levels match or you also need to use a voltage divider. Martin wrote that he managed to get firmware data using a similar adapter, but you also did it at the very beginning of the research, and this does not prove anything that the atmega8 chip is bad, it just may be necessary, as in the experience with spi, to use registers or inserts in c. But we want to get the result using FC software. Interestingly, the modules of the FC program (uart, spi and others are the same for different controllers or are they different?!)After reading the code of what these modules consist of, it will be possible to understand whether in our case it is worth using the atmega8 controller-since the code consists of the c language and registers, but the registers for pic and avr controllers are different!

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

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

Post by chipfryer27 »

Hi

If you re-read Martin's tests, they suggest that the Mega8 is not a suitable chip to use for anything other than basic UART comms, which prohibits using the esp component. It is a bit like wanting to sail across the Atlantic but you only have very small rubber dinghy...... :)

Flowcode is target independent, meaning you can use the same code with multiple chips (only needing minor changes to suit).

Using the 328P is the way to go, and also consider using FCv10. It really isn't worth the trouble trying to make the Mega8 work when you have the 328P. Once you learn more about using the chip with the esp8266, AT commands and protocols you may then wish to go back and experiment with the Mega8 but for now we should just stick with the 328P.

To connect you PC to your chip, simply connect the following using jumpers

Chip (328P) - USB-TTL Adapter

Ground (0v) -- Ground (0v)
Tx -- Rx

Remember to have the same bauds :)

Regards

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

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

Post by gilanetugila »

Good evening! Now I tried to read the parcels of the letter "U" from the controller using a usb-ttl adapter and the terminal program-nothing happened, the signals go on the oscilloscope, and the terminal program window is empty. I checked it several times -I connected the esp-01 board to the adapter, checked the firmware version, the port determines correctly, writes the firmware version. And the letters "U" cannot be seen in the terminal window.
Attachments
Atmega328p_send_U.fcfx
(10.25 KiB) Downloaded 14 times

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

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

Post by chipfryer27 »

Hi

In the long term, it would be better for you if you had a USB-TTL adapter similar to this

https://www.amazon.co.uk/PL2303-Convert ... 06&sr=8-10

The one you have is designed to accommodate an esp module. I can only guess the connections with it and it may not work as I suspect. If I remember correctly though you "proved" the adapter by looping the Tx pin to the Rx pin and sending out some data from your PC, so it should work.

Refer back to getting the looped adapter working, then connect the adapter Rx to the Tx of your chip. Don't connect anything else yet as we need to take things a step at a time.

Did you remember to set the correct port and click on "connect"? Wouldn't be the first time I forgot....

Regards

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

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

Post by gilanetugila »

Good afternoon! Yes, I turned on the "connect" button in the program menu, but something went wrong. I followed the link you gave me. There was a kind of adapter similar to mine, only yours has a quartz resonator, and mine does not. But the chips are the same CH340. But for the purity of the experiment, I'll go get it today and try it. It will be good if it turns out!? I wanted to ask if such a converter as the one on the link would be suitable. It seems to be more convenient to use, but there is a different chip (there is also one with the same chip)and there doesn't seem to be a quartz resonator inside. https://www.amazon.co.uk/Serial-Downloa ... M3P9&psc=1

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

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

Post by chipfryer27 »

Hi

That link shows an adapter that only has +5v available as a power option (to power whatever). Many are out there that have both 5v and 3.3v.

It isn't too much of a problem as you can always drop the voltage using a divider or simply not connect it and power say your module from another source.

If you can though, try something along these lines

https://www.amazon.co.uk/dp/B07XRF152K/ ... F9kZXRhaWw

Yours, this and the link I posted earlier are all acceptable, you just need to understand what each can do and how to connect. Don't worry about what chip it uses as the interface, your PC will automatically find a driver for it.

Once you have one, plug it into your PC then connect it's Tx to it's Rx (loop them) and you should be able to send data from your PC around the loop back to itself.

Once you can do that simply ensure you are using the correct baud and connect to your 328P :)

Regards

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

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

Post by gilanetugila »

Good evening! I bought a usb-ttl adapter, installed the driver from the downloaded site. I saw my device in the device manager, set the communication speed to 115200 (as in the FC program) and in the terminal program, but I did not see any letters in the terminal program window, only the LED on my board is flashing. The red LED is on on the USB-TTL adapter.
Attachments
Atmega328p_flash_led_test_send_U.fcfx
(11.49 KiB) Downloaded 15 times

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

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

Post by chipfryer27 »

Hi

Did you do a loop test?

Plug your adapter in to your PC
loop the Tx to Rx
Open Terminal
Select correct Com Port
Connect
Type in anything and you should see it appear on your screen.

If not then try another Com port until you find it.

Once you can do the above, connect the Rx pin to your 328P

Regards

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

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

Post by gilanetugila »

Good evening! I connected my board and the Tx controller pin on it to the Rx adapter pin and connected the minus of the board and the minus(ground) of the adapter. I checked the connection with a tester, the connections are working. After I turned on the terminal program in which area (they are numbered) Should I write and send it? If I write something and send it to area(2), then I will receive a response in area(3), but this also works when nothing is connected.
Attachments
windows terminal.JPG
windows terminal.JPG (63.21 KiB) Viewed 1061 times

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

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

Post by chipfryer27 »

Hi

I would double check you are actually on Com1. Clicking the arrow beside will give you all options.

Once you are sure you have selected the correct Com, click on Connect.

Then whatever you type in Area 3 should appear in Area 1.

If you type in area 2 it won't be sent until you click the "send" button to the right of the area. Then it will appear in area 1

Regards

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

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

Post by gilanetugila »

Good evening! I found a malfunction: I have 2 usb connectors (ports) No. 6 and No. 3 on the front panel of my computer, I determined their numbers when I connected the usb-ttl adapter with the esp-01 module.Everything is fine there, you send the AT+GMR command and get the firmware version in the window (1). When I connect the adapter that I bought today, only 1 port appears in the terminal program window (regardless of which port on the front panel I insert it into). Well, accordingly, he does not react to anything. I tried to insert both the adapter at the same time, and after the adapter with the esp-01 module received the firmware version, I take it out and insert a new adapter there, and then it glitches again and writes type 1 port (and I can't select others when this adapter is inserted). I will try to remove the program that came with the driver for the new adapter and if the driver itself turns out, otherwise it is buggy.

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

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

Post by gilanetugila »

Good evening! I deleted the program, but nothing has changed. The driver is not being deleted. When I updated the configuration in the device manager, the inscription appeared in the place where the new adapter was: PL2303HXA PHASED OUT SINCE 2012.PLEASE CONTACT YOUR SUPPLIER. When trying to update the driver, the system writes that the best one is installed. I tried to update the driver from another source, nothing has changed.

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

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

Post by chipfryer27 »

Hi

I'm not sure I understand what you mean by deleting the program but driver is still there. Were you attempting to delete the driver?

It is better to not insert both adapters at the same time until you are sure both are good and can differentiate between them. Many times Windows get hung up with them.

Restart your PC and follow the instructions that came with the adapter / driver. Don't insert until it tells you to.

Check in Windows Device Manager that you can see it under USB (or such like).

Regards

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

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

Post by gilanetugila »

Good evening! The driver could not be rolled back. The "rollback driver" button does not work, on Wednesday I will try to roll back the system, maybe this event will help to remove an unnecessary driver. But the fact is that I downloaded it from the official website, there was information that the driver was not quite old 2022-2023 and from the beginning I installed it and after it appeared such an inscription about which I wrote above. And where did you download the driver for your adapter from, or is there a system driver? Such a bad story and braking. Maybe if we fail to recover on Wednesday, we will continue without finding out what comes through the terminal program or without it in any way? We also need to find out the firmware version and so that it is displayed on the lcd1602 screen, and not in the terminal program window, send data from one esp-01 device to another. And then I got stuck where, in principle, it seems to me that I did not need to climb...

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

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

Post by chipfryer27 »

Hi

Windows automatically found and installed drivers on W7 / 8.1 / 10 and 11.

Rollback could be a good idea.

I'm not sure why you wish to focus on obtaining the Firmware version on an LCD as there is a LOT of information to capture and display. I see zero need for this as you have already confirmed the version when you installed the firmware, and you can check it by using a PC if you wish. Really, there isn't any need to do this from your chip at all.

Bit rushed just now, will check back later.

Regards

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

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

Post by gilanetugila »

Good evening! Today I tried all possible options: I deleted the drivers of this device, installed others; then I simply deleted the driver of this device and installed the system one, rolled back the system, then another friend told me where to dig into the properties of the port and set the desired port, all this to one well-known human organ - to serve water... the same result will be achieved. I went to the store, returned this adapter, took another one on a 340 chip, I'll try. If it doesn't work out, please excuse me for my restlessness, I will take up other projects for a while. It happens that you run into the wall of your ignorance and it doesn't go, you need to take a break, maybe my time hasn't come to use the esp-01 module or something else and other problems need to be solved. At the same time, I wanted to ask how to delete non-informative messages in this branch so that future users do not clutter their heads?

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

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

Post by chipfryer27 »

Hi

I can well understand your frustrations but you are very close to getting things to work to don't give up. Don't try and jump in at the deep end straight away. Instead work through each step.

I am quite sure from your previous tests that the esp8266 module is working and your traces showed that the 328P chip is working. Take small steps and you will soon have them playing together.

Let me know how you get on with the new adapter.

Regards

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

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

Post by gilanetugila »

Good evening! Imagine -it turned out without any installation of drivers and programs. I sent the letter "U" from the controller, but the LED was flashing along the way. This was displayed on the terminal window. But it is necessary to remove excess from the forum anyway and I will be a little distracted by other tasks-unfortunately, the time and price window of opportunity to get the necessary part is not great. But not for long, from 2 weeks to 2 months. I'll write to you in person later, if you don't mind.
Attachments
Atmega328p_flash_led_test_send_U.fcfx
(11.49 KiB) Downloaded 19 times
1.JPG
1.JPG (56.17 KiB) Viewed 947 times

Post Reply