Hi Viktor
I've not actually created anything yet in Flowcode, but when I do it will be in v10.
So far, with regards to my SIM7600 module, I have only tested AT Commands sent over the module's USB port. That is due to convenience as I don't have a power supply and USB-Serial converter to hand. Once I do I will use the modules Tx/Rx pins as that is how any microcontroller running Flowcode will connect. I'll then send the AT Commands again to see if there are any differences.
Regards
Sending Data over Cellular Networks
-
- Valued Contributor
- Posts: 1528
- http://meble-kuchenne.info.pl
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 353 times
- Been thanked: 549 times
-
- Valued Contributor
- Posts: 1528
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 353 times
- Been thanked: 549 times
Re: Sending Data over Cellular Networks
Hi
Connecting over USB-USB I was unable to get the SIM7600E module to update ThingSpeak, getting error codes 400 or 406 returned depending on what I sent. I then tried to connect over the header pins using a USB-Serial adapter. It appeared the module had an issue somewhere with it's Tx pin as I could not get any reply from the module..
Not being able to investigate this further until back in my Evil Lab, I moved on to the SIM7670E module. Incidentally both modules were obtained from a cheap site in China and made by ANDTech with names of BK-7600E and BK-7670E.
Connecting over USB-USB, I had the 7670 updating ThingSpeak in no time at all (mainly coz of the time spent on the 7600......)
The AT commands sent are (reply in blue):-
AT
OK
AT+CSQ (check signal strength)
+CSQ: 19,99 (or something similar)
AT+CREG? (check Network Registration)
+CREG: 0,1
AT+CGREG? (check GPRS Registration)
+CGREG: 0,1
AT+CGDCONT=1,"IP","your_apn" (set your provider's Access Point Name)
OK
AT+NETOPEN (establish a data connection)
+NETOPEN: 0
AT+HTTPINIT (initialise HTTP functions)
OK
AT+HTTPPARA="URL","https://api.thingspeak.com /update?api_key=<your-key>&field1=x" (enter your unique key and value for field1 etc. NOTE: to stop forum compacting string I inserted a space between .com and /update. You need to remove this)
OK
AT+HTTPACTION=0 (initiate the above action. 0=GET 1=POST)
OK
+HTTPACTION: 0,200,x (200 is server code for OK all good, x is number of bytes received)
You can repeat the AT+HTTPPARA and AT+HTTPACTION commands to send more data as required.
To terminate service:-
AT+HTTPTERM
OK
The above is just a starting point and only a guide to demonstrate steps. I will update as I progress.
Regards
Connecting over USB-USB I was unable to get the SIM7600E module to update ThingSpeak, getting error codes 400 or 406 returned depending on what I sent. I then tried to connect over the header pins using a USB-Serial adapter. It appeared the module had an issue somewhere with it's Tx pin as I could not get any reply from the module..
Not being able to investigate this further until back in my Evil Lab, I moved on to the SIM7670E module. Incidentally both modules were obtained from a cheap site in China and made by ANDTech with names of BK-7600E and BK-7670E.
Connecting over USB-USB, I had the 7670 updating ThingSpeak in no time at all (mainly coz of the time spent on the 7600......)
The AT commands sent are (reply in blue):-
AT
OK
AT+CSQ (check signal strength)
+CSQ: 19,99 (or something similar)
AT+CREG? (check Network Registration)
+CREG: 0,1
AT+CGREG? (check GPRS Registration)
+CGREG: 0,1
AT+CGDCONT=1,"IP","your_apn" (set your provider's Access Point Name)
OK
AT+NETOPEN (establish a data connection)
+NETOPEN: 0
AT+HTTPINIT (initialise HTTP functions)
OK
AT+HTTPPARA="URL","https://api.thingspeak.com /update?api_key=<your-key>&field1=x" (enter your unique key and value for field1 etc. NOTE: to stop forum compacting string I inserted a space between .com and /update. You need to remove this)
OK
AT+HTTPACTION=0 (initiate the above action. 0=GET 1=POST)
OK
+HTTPACTION: 0,200,x (200 is server code for OK all good, x is number of bytes received)
You can repeat the AT+HTTPPARA and AT+HTTPACTION commands to send more data as required.
To terminate service:-
AT+HTTPTERM
OK
The above is just a starting point and only a guide to demonstrate steps. I will update as I progress.
Regards
-
- Valued Contributor
- Posts: 1528
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 353 times
- Been thanked: 549 times
Re: Sending Data over Cellular Networks
Hi Viktor
Haha, sorry for my misspelling
yes that's the one.
In it you can store 24 predefined macros, which makes things a little easier for me as I can step through a series of commands.
Do press and read the help button, as it has a couple of quirks.
To end the macro with CR simply add #013 (or $0D for hex) etc.
Regards
Haha, sorry for my misspelling

In it you can store 24 predefined macros, which makes things a little easier for me as I can step through a series of commands.
Do press and read the help button, as it has a couple of quirks.
To end the macro with CR simply add #013 (or $0D for hex) etc.
Regards
-
- Valued Contributor
- Posts: 1528
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 353 times
- Been thanked: 549 times
Re: Sending Data over Cellular Networks
Hi
Just connected the 7670 using the Header pins. No issue and not unexpectedly I needed to use an external 5v supply as my USB-Serial adapter couldn't supply the required current. My adapter can either use 3.3v or 5v logic levels so that negated the need to level shift.
Unfortunately though, my 7600 has no activity at all on the Tx pin, so that it being returned for a refund. Until I obtain a replacement I will continue with the 7670.
Regards
Just connected the 7670 using the Header pins. No issue and not unexpectedly I needed to use an external 5v supply as my USB-Serial adapter couldn't supply the required current. My adapter can either use 3.3v or 5v logic levels so that negated the need to level shift.
Unfortunately though, my 7600 has no activity at all on the Tx pin, so that it being returned for a refund. Until I obtain a replacement I will continue with the 7670.
Regards
-
- Valued Contributor
- Posts: 1528
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 353 times
- Been thanked: 549 times
Re: Sending Data over Cellular Networks
Hi
Applied for my refund via the well known cheap Chinese site which promised to respond within 48hrs. During such the manufacturer of the module, ANDtech, contacted me and are sending out a new module. Good service from them (and the local delivery company inform that they have it already).
I've had no luck getting the modules(s) to update TS other than by HTTP, and as I have no way of knowing what is actually being sent by the module(s) nor received by TS I thought I'd create my own server. I can then look at logs to see everything it receives.
As I no longer have a static IP at home I would need a dynamic DNS service. No-IP (www.noip.com) offers paid and free dynamic DNS services and whilst others are available, as I've used their services before and found them easy to use, I set up with them again.
I have a few Rasberry Pis so decided to use a 3B. I've not used one for quite a while and made the mistake of loading the Desktop version of 64-bit Bookworm (latest RPi OS). To say it was slow is a gross understatement. Glacial is a more apt description due to the limited resources..... Starting again using the headless version was a vast improvement and it now provides fast responses.
After update / upgrade etc I loaded Apache, PHP and MariaDB (similar to mysql). I setup port forwarding on my router to send traffic to the RPi, and as I read of issues using static IP on RPis I also bound an IP address to the RPi MAC address. Now when my router sees the RPi it automatically assigns the same address to it.
I then created a couple of PHP scripts to connect to my database and update values (key-pairs). Testing using my laptop proved successful over my LAN and using a browser on my phone (connected to 4G network) I could update the database via my No-IP service (http://myname.ddns.net/script?key-pair).
Setting up wasn't without a few issues as I'm now using latest versions of LAMP and some commands have changed since I last played. I might update this post to include a RPi server viewtopic.php?t=2248.
I did find an issue that I can't find any reference to. Being headless I need to login to the RPi via ssh. If I'm logged in for 24hrs the RPi disconnects. No matter what I try I cannot relogin from my laptop nor will it respond to any ping from my laptop and won't respond if I try and update my database using a browser on my laptop. However it is still visible and responds to other devices (e.g. another laptop or my phone). If I change my laptop's address everything is fine. If I reboot the RPi then things are fine until another 24hrs passes then the device I'm logged in with gets locked out so to speak. Guessing some security feature is causing this but I've not really looked more than a quick "google".
When I next get a chance I'll look at capturing all headers etc to compare, and also see if I can update using the module.
Regards
Applied for my refund via the well known cheap Chinese site which promised to respond within 48hrs. During such the manufacturer of the module, ANDtech, contacted me and are sending out a new module. Good service from them (and the local delivery company inform that they have it already).
I've had no luck getting the modules(s) to update TS other than by HTTP, and as I have no way of knowing what is actually being sent by the module(s) nor received by TS I thought I'd create my own server. I can then look at logs to see everything it receives.
As I no longer have a static IP at home I would need a dynamic DNS service. No-IP (www.noip.com) offers paid and free dynamic DNS services and whilst others are available, as I've used their services before and found them easy to use, I set up with them again.
I have a few Rasberry Pis so decided to use a 3B. I've not used one for quite a while and made the mistake of loading the Desktop version of 64-bit Bookworm (latest RPi OS). To say it was slow is a gross understatement. Glacial is a more apt description due to the limited resources..... Starting again using the headless version was a vast improvement and it now provides fast responses.
After update / upgrade etc I loaded Apache, PHP and MariaDB (similar to mysql). I setup port forwarding on my router to send traffic to the RPi, and as I read of issues using static IP on RPis I also bound an IP address to the RPi MAC address. Now when my router sees the RPi it automatically assigns the same address to it.
I then created a couple of PHP scripts to connect to my database and update values (key-pairs). Testing using my laptop proved successful over my LAN and using a browser on my phone (connected to 4G network) I could update the database via my No-IP service (http://myname.ddns.net/script?key-pair).
Setting up wasn't without a few issues as I'm now using latest versions of LAMP and some commands have changed since I last played. I might update this post to include a RPi server viewtopic.php?t=2248.
I did find an issue that I can't find any reference to. Being headless I need to login to the RPi via ssh. If I'm logged in for 24hrs the RPi disconnects. No matter what I try I cannot relogin from my laptop nor will it respond to any ping from my laptop and won't respond if I try and update my database using a browser on my laptop. However it is still visible and responds to other devices (e.g. another laptop or my phone). If I change my laptop's address everything is fine. If I reboot the RPi then things are fine until another 24hrs passes then the device I'm logged in with gets locked out so to speak. Guessing some security feature is causing this but I've not really looked more than a quick "google".
When I next get a chance I'll look at capturing all headers etc to compare, and also see if I can update using the module.
Regards
-
- Valued Contributor
- Posts: 1528
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 353 times
- Been thanked: 549 times
Re: Sending Data over Cellular Networks
Hi
After successfully creating my RAMP (Raspberry Pi / Apache / MariaDB / PHP) and testing using browsers, a process that wasn't without a few issues as mentioned above (some possibly of my own doing but I'm admitting nothing......), I attempted to update my database using key-pairs over the cellular network.
Incidentally the issue above about being locked out is resolved...
I first retested my "AT" code by updating ThingSpeak which was successful (code is as previous post), then changed the target address and key-pair to match my RAMP install.
I've mentioned before that I like to use a terminal program to establish what is needed before creating a Flowcode chart as this allows me to see in real time what is going on.
Using the module, as I still haven't figured out how to connect using TCP, I used HTTP and my target address is in the format
http://<myaddress>.ddns.net/update.php?Sensor=x&Value=y (where x and y are variables)
This format works fine to update from a browser on my phone.
Unfortunately I forgot or didn't appreciate (you decide which...) that dynamic addressing is a redirct and therefore return a 302 code from the dynamic server which informs your browser to then look for your site at another address. No issue for a browser at all but my terminal program (including any forthcoming Flowcode chart) isn''t a browser and doesn't know what to do. Without first establishing what works using a terminal program I probably wouldn't have spotted that code.
However as I know my external IP address I changed the target address to http://aaa.bbb.ccc.ddd/update.php?Sensor=x&Value=y and the SIM7670 successfully updated my database over the cellular network.
I'm not overly familiar with HTML but I believe that if using dynamic addressing I could get Flowcode to capture the server response and look for a 301/302 and if found parse for the actual target address within the returned header, then resend the message there.
Now that I can send to devices that I'm in control over I hope to explore the issue in using TCP. I also intend to install a MQTT broker on the RPi for testing, and I see that Benj documented such on the WiKi so I'll look there for guidance.
Regards
After successfully creating my RAMP (Raspberry Pi / Apache / MariaDB / PHP) and testing using browsers, a process that wasn't without a few issues as mentioned above (some possibly of my own doing but I'm admitting nothing......), I attempted to update my database using key-pairs over the cellular network.
Incidentally the issue above about being locked out is resolved...

I first retested my "AT" code by updating ThingSpeak which was successful (code is as previous post), then changed the target address and key-pair to match my RAMP install.
I've mentioned before that I like to use a terminal program to establish what is needed before creating a Flowcode chart as this allows me to see in real time what is going on.
Using the module, as I still haven't figured out how to connect using TCP, I used HTTP and my target address is in the format
http://<myaddress>.ddns.net/update.php?Sensor=x&Value=y (where x and y are variables)
This format works fine to update from a browser on my phone.
Unfortunately I forgot or didn't appreciate (you decide which...) that dynamic addressing is a redirct and therefore return a 302 code from the dynamic server which informs your browser to then look for your site at another address. No issue for a browser at all but my terminal program (including any forthcoming Flowcode chart) isn''t a browser and doesn't know what to do. Without first establishing what works using a terminal program I probably wouldn't have spotted that code.
However as I know my external IP address I changed the target address to http://aaa.bbb.ccc.ddd/update.php?Sensor=x&Value=y and the SIM7670 successfully updated my database over the cellular network.
I'm not overly familiar with HTML but I believe that if using dynamic addressing I could get Flowcode to capture the server response and look for a 301/302 and if found parse for the actual target address within the returned header, then resend the message there.
Now that I can send to devices that I'm in control over I hope to explore the issue in using TCP. I also intend to install a MQTT broker on the RPi for testing, and I see that Benj documented such on the WiKi so I'll look there for guidance.
Regards
-
- Valued Contributor
- Posts: 1528
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 353 times
- Been thanked: 549 times
Re: Sending Data over Cellular Networks
Hi
Installing a MQTT broker on my RPi was quite straightforward using the WiKi as a guide. I also included some additional security such as username and password. Plenty of information online and I'm happy to share my steps if anyone is interested.
I have MQTTX installed on a laptop and this allows me to set the credentials to publish & subscribe to a broker. Once connected I can publish, and any new messages that arrive appear in the laptop too. From the RPi, using the CLI I can also publish & subcribe so I published a few test messages which automatically appeared on MQTTX.
This is obviously good, proving that it works, and as MQTTX allows me to easily set site credentials it will be helpful in establishing "Flowcode", especially as the documentation / terminology used in certain sites can be a bit confusing.
My replacement 7600E arrived a few days ago, so I hope to test it soon.
Regards
Installing a MQTT broker on my RPi was quite straightforward using the WiKi as a guide. I also included some additional security such as username and password. Plenty of information online and I'm happy to share my steps if anyone is interested.
I have MQTTX installed on a laptop and this allows me to set the credentials to publish & subscribe to a broker. Once connected I can publish, and any new messages that arrive appear in the laptop too. From the RPi, using the CLI I can also publish & subcribe so I published a few test messages which automatically appeared on MQTTX.
This is obviously good, proving that it works, and as MQTTX allows me to easily set site credentials it will be helpful in establishing "Flowcode", especially as the documentation / terminology used in certain sites can be a bit confusing.
My replacement 7600E arrived a few days ago, so I hope to test it soon.
Regards
-
- Posts: 74
- Joined: Thu Jun 16, 2022 6:16 pm
- Has thanked: 110 times
- Been thanked: 13 times
-
- Valued Contributor
- Posts: 1528
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 353 times
- Been thanked: 549 times
Re: Sending Data over Cellular Networks
Hi
Just tested my MQTT install using the Flowcode MQTT component (based on the WiKi example) and it worked fine. This was over my LAN. Just need to now get everything running over GSM/LTE.
I'll update my guide too.
Regards
Just tested my MQTT install using the Flowcode MQTT component (based on the WiKi example) and it worked fine. This was over my LAN. Just need to now get everything running over GSM/LTE.
I'll update my guide too.
Regards