WiFi Communication with ESP8266

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

Moderator: Benj

hyperion007
Posts: 528
Joined: Sat Dec 01, 2012 1:23 pm
Location: Sweden
Contact:

Re: WiFi Communication with ESP8266

Post by hyperion007 »

Thanks Kersing, will do as soon as I get home from work.

Could you tell me what is changed in that version of the component? And it needs to be the latest version with the \r\n option as the older version you modified for me didn't work for with 8-bit PIC, but did work with dsPIC. I'll still try it of course :)

kersing
Valued Contributor
Valued Contributor
Posts: 1991
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Contact:

Re: WiFi Communication with ESP8266

Post by kersing »

I fixed a reference to what I think is an unused variable in the current code. However, it is based on the older sources as I do not have the newest ones.

Does the same ESP8266 module work on dsPIC without the option and not on 8 bit PIC?
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

hyperion007
Posts: 528
Joined: Sat Dec 01, 2012 1:23 pm
Location: Sweden
Contact:

Re: WiFi Communication with ESP8266

Post by hyperion007 »

Yes that's what struck me as being strange as well.

hyperion007
Posts: 528
Joined: Sat Dec 01, 2012 1:23 pm
Location: Sweden
Contact:

Re: WiFi Communication with ESP8266

Post by hyperion007 »

I've tried it now, it doesn't work. It won't even create the AP

hyperion007
Posts: 528
Joined: Sat Dec 01, 2012 1:23 pm
Location: Sweden
Contact:

Re: WiFi Communication with ESP8266

Post by hyperion007 »

So I guess we have to wait for Ben to have time to look at this. Hopefully soon as I need this function to complete a prototype that needs to be done in a hurry in order to get a contract for the final product.

kersing
Valued Contributor
Valued Contributor
Posts: 1991
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Contact:

Re: WiFi Communication with ESP8266

Post by kersing »

Fixed version of the component.
Attachments
WLAN_ESP8266.fcpx
(15.36 KiB) Downloaded 242 times
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

hyperion007
Posts: 528
Joined: Sat Dec 01, 2012 1:23 pm
Location: Sweden
Contact:

Re: WiFi Communication with ESP8266

Post by hyperion007 »

And I can vouch for it working :)

User avatar
Benj
Matrix Staff
Posts: 15145
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Contact:

Re: WiFi Communication with ESP8266

Post by Benj »

Hello,

Here is the component, Jac reported to me that he simply had to re-export the current source but that this broke the GUI for the component.

So here is the current version as used in the latest IoT blogs.
WLAN_ESP8266.fcpx
(22.04 KiB) Downloaded 213 times

hyperion007
Posts: 528
Joined: Sat Dec 01, 2012 1:23 pm
Location: Sweden
Contact:

Re: WiFi Communication with ESP8266

Post by hyperion007 »

I have another problem now... :(

There seems to be a 18 character limit when sending string variables from the web form to the PIC.

I have set the string variable to [60] and [80] but still only 18 bytes are received.
Trying to send "123456789012345678901234567890" results in "123456789012345678" and 18=Length$(string_var)
How do I increase this?

User avatar
Benj
Matrix Staff
Posts: 15145
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Contact:

Re: WiFi Communication with ESP8266

Post by Benj »

Hello,

Are you using the SetOutValue and GetInValue macros? If so then which specific index receives the long string and I will try and extend it for you.

Otherwise can you post your program so I can see how your collecting the data.

hyperion007
Posts: 528
Joined: Sat Dec 01, 2012 1:23 pm
Location: Sweden
Contact:

Re: WiFi Communication with ESP8266

Post by hyperion007 »

I am indeed using those macros and I think only index "0" will be longer than 18 characters.

ahmedkhalid
Posts: 28
Joined: Mon May 26, 2014 8:51 pm
Contact:

Re: WiFi Communication with ESP8266

Post by ahmedkhalid »

Just tried the latest version of the component upload by ben and got this error while making hex file of it.

Error returned from [avr-gcc.exe]
Completed compilation, return = 1
C:\Program Files (x86)\Flowcode 6\compilers\avr\batchfiles\avra.bat reported error code 1

kersing
Valued Contributor
Valued Contributor
Posts: 1991
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Contact:

Re: WiFi Communication with ESP8266

Post by kersing »

ahmedkhalid wrote:Just tried the latest version of the component upload by ben and got this error while making hex file of it.

Error returned from [avr-gcc.exe]
Completed compilation, return = 1
C:\Program Files (x86)\Flowcode 6\compilers\avr\batchfiles\avra.bat reported error code 1
Please post all output lines as these lines do not contain the information we need to help. (The output can be found in a .txt file starting with the project name located in the same folder your project is saved.) Adding your flowcode file to your post also helps...
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

User avatar
Benj
Matrix Staff
Posts: 15145
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Contact:

Re: WiFi Communication with ESP8266

Post by Benj »

Hello,

Here is a version of the component with the in-coming buffer 0 set to a max of 60 characters. I should be able to allow this to be configurable in the component properties if it becomes a big problem.
WLAN_ESP8266.fcpx
(22.04 KiB) Downloaded 187 times

hyperion007
Posts: 528
Joined: Sat Dec 01, 2012 1:23 pm
Location: Sweden
Contact:

Re: WiFi Communication with ESP8266

Post by hyperion007 »

Thanks! I'll put it to the test tonight.

User avatar
Benj
Matrix Staff
Posts: 15145
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Contact:

Re: WiFi Communication with ESP8266

Post by Benj »

Hello,

Thought I would go the extra mile while i'm in the source. Here is a version with adjustable length strings for in and out.
WLAN_ESP8266.fcpx
(22.27 KiB) Downloaded 176 times

hyperion007
Posts: 528
Joined: Sat Dec 01, 2012 1:23 pm
Location: Sweden
Contact:

Re: WiFi Communication with ESP8266

Post by hyperion007 »

I really appreciate the effort but it still only shows 18 characters. Tried both versions of the component.
Is there a limitation elsewhere?

User avatar
Benj
Matrix Staff
Posts: 15145
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Contact:

Re: WiFi Communication with ESP8266

Post by Benj »

Hello,

I've had another look and nothing obvious is jumping out at me.

Is it possible for you to post your program or something that demonstrates the problem. Might need to have a look through the C code to see if I can spot whatever is causing the limitation.

Otherwise could be that WIFI module is truncating the incoming URL request but this seems unlikely.

hyperion007
Posts: 528
Joined: Sat Dec 01, 2012 1:23 pm
Location: Sweden
Contact:

Re: WiFi Communication with ESP8266

Post by hyperion007 »

I'll send you the program via PM right now.

User avatar
Benj
Matrix Staff
Posts: 15145
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Contact:

Re: WiFi Communication with ESP8266

Post by Benj »

Cheers for that,

I think I've found the problem now. There was a intermediary string variable which collected the data as part of the CheckForPageRequests macro. I've now changed this so it populates the dynamic sized variables directly.

Fingers crossed this will fix the issue.
WLAN_ESP8266.fcpx
(22.44 KiB) Downloaded 177 times

hyperion007
Posts: 528
Joined: Sat Dec 01, 2012 1:23 pm
Location: Sweden
Contact:

Re: WiFi Communication with ESP8266

Post by hyperion007 »

Thanks, I'll try it at once :)

User avatar
Benj
Matrix Staff
Posts: 15145
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Contact:

Re: WiFi Communication with ESP8266

Post by Benj »

Sorry found another issue now, there is also a fixed 18 character cap!!!

Anyway should be fixed now to cap the number of bytes at 1- the dynamic value to allow room for the null termination. Sorry to give you the run around.
WLAN_ESP8266.fcpx
(22.48 KiB) Downloaded 183 times

hyperion007
Posts: 528
Joined: Sat Dec 01, 2012 1:23 pm
Location: Sweden
Contact:

Re: WiFi Communication with ESP8266

Post by hyperion007 »

There we go! :) Now it works!

No worries, I'm just happy to get it working. Thanks for all your help!

ahmedkhalid
Posts: 28
Joined: Mon May 26, 2014 8:51 pm
Contact:

Re: WiFi Communication with ESP8266

Post by ahmedkhalid »

Kersing worte:

Please post all output lines as these lines do not contain the information we need to help. (The output can be found in a .txt file starting with the project name located in the same folder your project is saved.) Adding your flowcode file to your post also helps...
Here is the text file I just initalise the ESP8266 component and tried to make its hex file and got error. I am now using the most latest component version uploaded by benj i.e.
Benj wrote:Sorry found another issue now, there is also a fixed 18 character cap!!!

Anyway should be fixed now to cap the number of bytes at 1- the dynamic value to allow room for the null termination. Sorry to give you the run around.

WLAN_ESP8266.fcpx
Plus one more thing the only way I get rid of this error is by using the component version originally uploaded by benj...
Benj wrote:Hello,

Here is the progress so far...

Here is the component, need to be copied to the "C:\Program Files (x86)\Flowcode 6\components" directory before restarting Flowcode.
The attachment WLAN_ESP8266.fcpx is no longer available
It's not 100% complete but is fairly reliable.
Attachments
Test_Esp8266.msg.txt
(4.35 KiB) Downloaded 256 times

kersing
Valued Contributor
Valued Contributor
Posts: 1991
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Contact:

Re: WiFi Communication with ESP8266

Post by kersing »

ahmedkhalid wrote:Here is the text file I just initalise the ESP8266 component and tried to make its hex file and got error. I am now using the most latest component version uploaded by benj i.e.
You could try the component attached to this forum post. That should get rid of the errors. Keep in mind it is based on an older source so extracting the parameters will not work. I expect Ben will post an updated component with all fixes in the near future.
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

Post Reply