IOT_Made_Easy - or not?

For general Flowcode discussion that does not belong in the other sections.
chipfryer27
Valued Contributor
Posts: 1195
http://meble-kuchenne.info.pl
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 289 times
Been thanked: 418 times

Re: IOT_Made_Easy - or not?

Post by chipfryer27 »

Thought I'd save some for tomorrow. Now on Talisker which never disappoints :)

chipfryer27
Valued Contributor
Posts: 1195
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 289 times
Been thanked: 418 times

Re: IOT_Made_Easy - or not?

Post by chipfryer27 »

Hi

As you might have guessed, the Talisker did an astounding job and I highly recommend it (although Highland Park may be more geographically suited :D ). Today was more theory than practical. I thought about doing stuff but the chances of that happening were practically zero....

How did you get on with IME?

Found the old drive that may contain using mqtt to update TS. If it does I'll post.

Regards

chipfryer27
Valued Contributor
Posts: 1195
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 289 times
Been thanked: 418 times

Re: IOT_Made_Easy - or not?

Post by chipfryer27 »

Hi

Simulating my mqtt chart updated TS however I think it is corrupted somehow as it displays variables not used in the project at all. I need to look at it in daylight before posting.

Regards

mnfisher
Valued Contributor
Posts: 1006
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 106 times
Been thanked: 519 times

Re: IOT_Made_Easy - or not?

Post by mnfisher »

I haven't tried this evening - bad day at work (no rest for the wicked?)

Something not right - FC running very slowly (and lots of crashes in sim).

So wrote a brainf**k compiler - for a much more frustrating language. It sort of works - just got to get around the wdt on esp32 (it is slow! - though hello world works pretty quickly) and do the input.
The program to print 'A' (----[---->+<]>++.) works. Just attempting 'Hello world' - which also works !!!!
(++++++++++[>+>+++>+++++++>++++++++++<<<<-]>>>++.>+.+++++++..+++.<<++++++++++++++.------------.>+++++++++++++++.>.+++.------.--------.<<+.)

Then to try mandelbrot.bf (someone has done it)

See https://en.wikipedia.org/wiki/Brainfuck
bf.fcfx
(30.13 KiB) Downloaded 12 times

Martin

mnfisher
Valued Contributor
Posts: 1006
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 106 times
Been thanked: 519 times

Re: IOT_Made_Easy - or not?

Post by mnfisher »

After a bit more 'fiddling':

I couldn't get IOT_MadeEasy to work, nor the MQTT component.

So - back to basics with the NetworkComms component. And finally - a working MQTT update from a esp32 (phew)

One issue - I had SSID and Password as constants in main - Wifi fails to connect (an issue with string constants?) You'll need to change these to match your router's details (in the ConnectToSSID macro).

I call the user agent 'LoftMonitor' - you 'might' need to change this (I changed this to the thingspeak mqtt devices ClientID - though this may not be necessary)

You'll need to set key (a local in main) to your WriteAPIKey.

Here - it sends an integer to field1 (increases by 10 (% 100)) every 20s

It actually works !!! ;) With the value changing on the thingspeak display in (almost) real time.....

It also outputs the data written to thingspeak to the UART (for debug purposes). There is a complete lack of error checking (connection / anywhere)
MQTTTest.fcfx
(22.75 KiB) Downloaded 11 times



Martin

mnfisher
Valued Contributor
Posts: 1006
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 106 times
Been thanked: 519 times

Re: IOT_Made_Easy - or not?

Post by mnfisher »

And I thought of a big improvement to the brainf*** compiler while I did it :-)

chipfryer27
Valued Contributor
Posts: 1195
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 289 times
Been thanked: 418 times

Re: IOT_Made_Easy - or not?

Post by chipfryer27 »

Hi

Sorry, a little busy this week and I've not had time to post my TS mqtt file. If using the "free" version of TS then you are limited to how many posts you can make and also frequency too. I could only reliably post every 12 - 15 seconds or so.

Regards

mnfisher
Valued Contributor
Posts: 1006
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 106 times
Been thanked: 519 times

Re: IOT_Made_Easy - or not?

Post by mnfisher »

Yes - seems to be limited in some way. Just reached 60 samples and it's stopped ?

Will play some more tomorrow.

I used the thing speak code from the Arduimo which gave a 'POST' command of:

Code: Select all

POST /update HTTP/1.1
Host: api.thingspeak.com
User-Agent: LoftMonitor
X-THINGSPEAKAPIKEY: MyAPIKey
Content-Type: application/x-www-form-urlencoded
Content-Length:23
field1=30&headers=false
I'm not sure how the Channel ID fits in to it all though. The (Arduino) code has a channel id but never seems to use it. I just used the WriteAPI code - but the ' GET ...." on the thingspeak site seemed to work when used as an URL in a browser but I couldn't make it work on MCU.

Hope the work is going smoothly!

Martin

chipfryer27
Valued Contributor
Posts: 1195
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 289 times
Been thanked: 418 times

Re: IOT_Made_Easy - or not?

Post by chipfryer27 »

Hi

I've been down South (or up North depending on viewpoint) for a few days this week in the Lake District. I've not been there since childhood and I'd forgotten how beautiful it is. Day trips, so long days and I'm just heading off there again today. No hardship with the scenery I pass through :)

As a bonus (if needed) Cumbria has loads of craft breweries so I'm thinking of renting a dreyhorse instead of a car :)

Regards

mnfisher
Valued Contributor
Posts: 1006
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 106 times
Been thanked: 519 times

Re: IOT_Made_Easy - or not?

Post by mnfisher »

Sounds great - don't forget the pencil museum.

A holiday needs no more...

Post Reply