Arduino Nano + GPS + GPRS + LoRa + WebSocket + PHP + MySQL

Hello I’m working on a project in which I need to remotely control, Radio Communication Towers Autonomous Safety Lights.

At the top of the tower there’s the Master light ,that sends data via GPRS to a central server, for example, the GPS location, battery status, charge status ,condition ON/OFF, blinks per second and a few things more.

On the lower levels, the other lights ( you can have more than 1 light on each floor, more specifically, one in each corner, or at least 2 lights, on opposite sides ), report their status to the master/

The idea is to interconnect for examples 2 towers to get redundancy, in case the cellular network goes down, and use LoRa to send messages between towers (10 miles maximum ).

I’ve been testing alone each of the modules that I have, and they seem to work fine, but I’m having a bit of trouble to get all the system working together.

Actually I can read the NMEA sentences from the GPS, and I can contact servers using my modem.

But after watching the server with MySQL database, there’s no trace of the data being sent.

Maybe the PHP script is wrong, but really it looks so simple that I doubt that’s the problem. I believe that the delays I wrote after each of the AT commands ,are giving me some trouble. But I don’t have any previous experience with this kind of stuff.

My Arduino has plenty of space left and is working fine.

The idea is to send the GPS data to the MySQL server with the SIM800L, establish a WebSocket to interact between the Arduino and the server, and the WebPage and the server, so I can control for example the switching of the lights, the brightness and also show the location in google maps of the light (I’m planning on using GeoFencing to detect movement of the lights, besides having a shock sensor ).

If there’s some kind of alarm it will send an email to a list of recipients.

I need to protect the access to the web page with a simple user/password, and if its possible…log time and date of each user that logs in.

I know I’ve wrote a lot and that can be a little bit intimidating but ……

If someone is willing to help me I can post the code and start to troubleshoot it.

Thank you in advance.

My hardware specs are:

Modem SIM800L

GPS UBLOX 7

Arduino Nano

LoRa DRF1278DM

Software specs:

Arduino IDE

PHP Servers Programming

HTML Client

Database MySQL

Google Maps API

If you post your project details at multiple sites I would strongly recommend nominating one of those sites as the primary one you will work with, and referring to that site from your other posts, with a summary of the project. That will remove the need to duplicate your responses to multiple similar replies, and anyone who chooses to offer advice can see what others are suggesting and comment on those suggestions.
All About Circuits
Electronics Forum (Circuits, Projects and Microcontrollers) (electro-tech-online.com)
Using Arduino / Programming Questions - Arduino Forum

1 Like

Hi SouthCoding,

It sounds like you’re in integration hell, where each individual part of your system works, but put them all together and the system does not.

Generally a forum is only good for specific problems, because sifting through someone elses sprawling system is hugely time-consuming, but I can offer some advice from my own time in integration hell (you may think these are common sense):

  • Start with black box tests of your components:
    • You’ve already done this if you know your components work, but it’s an important step. Be sure to feed the components actual data rather than just test strings, and check raw outputs.
  • Gradually build up your system one part at a time
  • Stick your nose in between components. I.e. if you have a serial link somewhere, use a logic analyser or usb-to-serial chip to verify the data is being sent correctly. Use Wireshark to verify your IP traffic is coming through as intended. Put debug outputs in your code to see “how far” something it getting.

When you have a single or set of specific issues, get back to us and we’ll go deep to help you troubleshoot.

1 Like

That sounds great, I didn’t know that it was good manners to post in one forum a reference to the other. For me, it would be great if I can have a forum that integrates all the questions.

Can you advice me which forum is the one that has more visibility so I can post there and make a reference ?
Also,if the users from other forums want to answer, they need to get an account to the new forum, or the idea is to answer where it was quoted?

Thanks.

Thank you for your help, you gave me great ideas to check things and move on. I’ll try as much as I can, to assure I get a positive outcome of the three points you told me.