Populating MySQL database function.

Post here to discuss any new features, components, chips, etc, that you would like to see in Flowcode.
RGV250
Posts: 264
http://meble-kuchenne.info.pl
Joined: Sat Mar 19, 2022 4:53 pm
Has thanked: 23 times
Been thanked: 30 times

Re: Populating MySQL database function.

Post by RGV250 »

Hi,
To start with it will only be one message every 5 seconds or so but later may end up with 15 so still only 3 / sec average.

Bob

LeighM
Valued Contributor
Posts: 401
Joined: Mon Dec 07, 2020 1:00 pm
Has thanked: 71 times
Been thanked: 217 times

Re: Populating MySQL database function.

Post by LeighM »

Just to add another piece to the jigsaw puzzle and good work from chipfryer27
Here's a demo of the capabilities of GNU/Linux and Flowcode.

This script will install mysql and create a demo database and table.
Edit the user 'leigh' to your login account and download it to your Raspberry Pi.
In the terminal (or putty, ssh), make the file executable (chmod 777 setup_db.txt) and run it (./setup_db.txt)
setup_db.txt
(389 Bytes) Downloaded 115 times

Similarly, this script can be used to test the DB and data insert.
insert_db.txt
(148 Bytes) Downloaded 121 times

And here is a demo Flowcode project that records temperature measurements to the test DB.
RPI_SHT21_DB.fcfx
(10.85 KiB) Downloaded 128 times

Hope it helps, at least it will get you started with SQL statements. :D

chipfryer27
Valued Contributor
Posts: 1149
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 285 times
Been thanked: 412 times

Re: Populating MySQL database function.

Post by chipfryer27 »

Hi Leigh

Thanks for the above.

I'm creating a little guide regarding this and Bob is helping proof read. It will show how to create a DB and tables, then the steps to create a script that will update tables etc. Then a Flowcode example that updates.

Interesting to see your use of script, different to mine but then you are after all a Guru :D

Regards

RGV250
Posts: 264
Joined: Sat Mar 19, 2022 4:53 pm
Has thanked: 23 times
Been thanked: 30 times

Re: Populating MySQL database function.

Post by RGV250 »

Hi Martin,
Apologies for not replying earlier, I will have a play with your example later, I have been spending a lot of time with the example from Chipfryer and the brain cell cannot handle more than one thing at a time.

Bob

RGV250
Posts: 264
Joined: Sat Mar 19, 2022 4:53 pm
Has thanked: 23 times
Been thanked: 30 times

Re: Populating MySQL database function.

Post by RGV250 »

I should have mentioned Leigh in the post above, I was thinking of Martin in a different post :oops: :oops: :oops:
I have just managed to modify chipfryers example to run on a Raspberry Pi from the other post and simulate it with everything on the same PC so this will come in very handy when I test it out on the actual Raspberry Pi hardware.

Regards,
Bob

chipfryer27
Valued Contributor
Posts: 1149
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 285 times
Been thanked: 412 times

Re: Populating MySQL database function.

Post by chipfryer27 »

Hi

I updated the guideviewtopic.php?f=3&t=2248 to include latest MySql and PHP.

Regards

Post Reply