KenLagoni / MavlinkGPRS

Mavlink Telemetry from drone to server via GPRS (SIM800l)
11 stars 2 forks source link

Asking question #1

Closed mohanbabi closed 3 years ago

mohanbabi commented 3 years ago

Can i use Arduino uno instead of Arduino MKRZero.

KenLagoni commented 3 years ago

Just to be 100% sure.... the SIM card is from Airtel company yes?

mohanbabi commented 3 years ago

IMG_20210728_191949 IMG_20210728_193236 Sir see sir connections

Just to be 100% sure.... the SIM card is from Airtel company yes?

yes Sir my sim is Airtel

KenLagoni commented 3 years ago

But this is not an MKRZero, but an UNO. So you use UNO for debug and MKRZero for MavlinkGPRS?

Anyway UNO can't use 115200 very well, this explains the wrong charactors. Change baudrate back to 9600.

KenLagoni commented 3 years ago

Also the SIM800L must have 3.7V-4.2V It looks like you are powering it from 3.3V or 5V. If the signal is bad it use more power and thus it needs to draw 2A from 3.7-4.2V. So use a Li-ion or Lipo cell.

mohanbabi commented 3 years ago

is UNO is not support to 115200 baud rate? sir. I do not have thinkspeak data upload code for MKRzero.

I am using 5V supply. It worked properly at 9600 baud rate, with this setup.😁

KenLagoni commented 3 years ago

is UNO is not support to 115200 baud rate? sir. I do not have thinkspeak data upload code for MKRzero.

No not on softserial.

I am using 5V supply. It worked properly at 9600 baud rate, with this setup.😁

Please don't it will damage the SIM800L chip. Also you may be using 5V but you can't draw 2A from USB, normally only 0.5A. But if you are close to the GSM tower then it doesn't use as much and may work but it is not recommended.

KenLagoni commented 3 years ago

I would go back to 9600 on UNO and SIM800L. If you still get "+PDP: DEACT" after the AT+CIICR command then I would fix the hardware with correct power supplier and try again.

mohanbabi commented 3 years ago

Please don't it will damage the SIM800L chip. Also you may be using 5V but you can't draw 2A from USB, normally only 0.5A. But if you are close to the GSM tower then it doesn't use as much and may work but it is not recommended.

Ok sir, i am in my house. that is the reson i am used 5v supply. for just checking AT commands and thinkspeak data upload.

I would go back to 9600 on UNO and SIM800L. If you still get "+PDP: DEACT" after the AT+CIICR command then I would fix the hardware with the correct power supplier and try again.

Sir, for the power issue, i am using lion battery single cell. i forgot in my office.

mohanbabi commented 3 years ago

@KenLagoni just now, i have done with port forwarding in my home. i have sent message to my laptop using public ip. now i am partially understood mavlink server.

KenLagoni commented 3 years ago

I have just finished testing with latest Arduplane v4.0.9, and it works for me. I found a bug and decided to update the MavlinkGPRS program to let the user decided to use default parameters, because took so long downloading them every time.

I have also updated documentation with your feedback, thanks :-)

Please pull latest data for your tests and build again.

mohanbabi commented 3 years ago

good morning @KenLagoni Sir.

Please pull latest data for your tests and build again.

If this will work I will go flying this weekend.

today's test, I will give update.

mohanbabi commented 3 years ago

logs.txt

AT+CIICR

This is giving ERROR. I used 4.2V 2200mah Lion battery as power.

mohanbabi commented 3 years ago

IMG_20210729_131126_1 Please send me your connection picture sir, if possible.

KenLagoni commented 3 years ago

I would get the "thingspeak" to work first. Then when you know you have a working SIM800L module you can try my program.

The problem is related to the SIM800L not getting a wireless connection.

I would test the following:

  1. Ensure that DATA is available on SIM (try it in a 4G dongle)
  2. Try another SIM800L module, perhaps giving it 5V has damaged something.
  3. Try another SIM Card.
  4. Ensure correct antenna is mounted, ie. try another/better one.
mohanbabi commented 3 years ago

https://www.electronicscomp.com/sim800l-v2-5v-wireless-gsm-gprs-module-quad-band-with-antenna?gclid=CjwKCAjwo4mIBhBsEiwAKgzXOOUNxM-PHuga1IbkY7GU1GTMIMwcrC-LMmpfTo9rIwqw85IOGJvvYBoClioQAvD_BwE

This sim 800l is ok

KenLagoni commented 3 years ago

https://www.electronicscomp.com/sim800l-v2-5v-wireless-gsm-gprs-module-quad-band-with-antenna?gclid=CjwKCAjwo4mIBhBsEiwAKgzXOOUNxM-PHuga1IbkY7GU1GTMIMwcrC-LMmpfTo9rIwqw85IOGJvvYBoClioQAvD_BwE

This sim 800l is ok

The SIM800L does not accept 5V, but that version of the PCB has a small power supplier so it can accept 5V (I have the this board also).

What it has is the two diodes mounted on the PCB: image

The board you have is the small "red" one which does not have this, and thus VCC is 3.7-4.2V for this board. (check where you bought it).

mohanbabi commented 3 years ago

CAN i buy this. i need to place an order. Its having diode

image

mohanbabi commented 3 years ago

@KenLagoni sir are you from which country

thsi message is editing using testing Sim @KenLagoni Sir.

KenLagoni commented 3 years ago

Yes that board is fine. Does it comes with an antenna, that would be best: image

https://www.banggood.com/SIM800L-Module-Board-Quad-Band-SMS-Data-GSM-GPRS-Globally-Available-For-Smart-Home-Switch-p-1062819.html?utm_source=googleshopping&utm_medium=cpc_organic&gmcCountry=DK&utm_content=minha&utm_campaign=minha-dk-en-pc&currency=DKK&cur_warehouse=CN&createTmp=1&ID=514182&utm_source=googleshopping&utm_medium=cpc_bgs&utm_content=sandra&utm_campaign=sandra-ssc-dk-en-all-0701-20LP&ad_id=445673209611&gclid=CjwKCAjwo4mIBhBsEiwAKgzXOOPo31UzNWFepRLbnbSU9ZjmUUtx2fkt-WuiGWT0xapp9CxCUS2evBoCWTwQAvD_BwE

Remember that the 5V can't come from the USB / ARduino. You need a PSU which can deliver up to 2A!. I have connected mine to the 5V PSU which makes my Servo voltage.

KenLagoni commented 3 years ago

@KenLagoni sir are you from which country

Denmark, you?

mohanbabi commented 3 years ago

@KenLagoni Sir i am from India.

i will order now sim800l, which is I have sent. In india customs office will stop electronics products.

Sir present SIM is working Sir. these chat is done by that SIM only

mohanbabi commented 3 years ago

@KenLagoni Sir I tested with new sim800l , which i had show above. please look into log

GPRS log.txt

thank you sir good night

KenLagoni commented 3 years ago

Looks good, you are now connected and ready to send data. Now you need to feed the Mavlink data to the MKRZero and you should see the data transmitted increasing: "Total Bytes: 0 Bandwidth: 0 byte/sec".

FYI: You should not fly with DEBUG_MODE 1, I'm not sure it is stable. So when you are ready to fly, set DEBUG_MODE 0.

mohanbabi commented 3 years ago

@KenLagoni SIR

feed the Mavlink data to the MKRZero and you should see the data transmitted increasing: "Total Bytes: 0 Bandwidth: 0 byte/sec".

I will do, Sir and will observe some time and after make a circuit.

You should not fly with DEBUG_MODE 1, I'm not sure it is stable. So when you are ready to fly, set DEBUG_MODE 0.

Ok sir I will change back.

Sir, please teach me how to work with the GPRS server. like how to make communicate with sim800l. I am trying sir but no use. It is worked with the Nokia router(this is not mine), not working with the D-link router(this is mine). Any help

Thank you, sir

KenLagoni commented 3 years ago

@KenLagoni SIR Sir, please teach me how to work with the GPRS server. like how to make communicate with sim800l. I am trying sir but no use. It is worked with the Nokia router(this is not mine), not working with the D-link router(this is mine). Any help

Let's assume your setup is like this: The D-link router is your Internet router which is connected directly to the internet with a public IP: 103.248.211.75 (This is the IP you have specified in the SIM800L code according to the log you sent. You can verify this by going to www.myip.com from the Linux PC).

The GPRS server is running on Linux PC which is connected to the D-link router LAN (lets say the PC has local ip: 192.168.0.120 but you can use the one you have).

The D-link router must be set to forward traffic (port forward) on the TCP and UDP port which the SIM800l is using (port: 14450 according to the log).

It should look something like this: image

When this works, the SIM800l will sent UDP Mavlink to the D-link router, which will forward it to the PC running GPRS server. The GPRS server will output log when it starts and the when it start to receive data from the SIM800l.

This is how I would test it:

  1. Verify Mavlink data is transmitted from SIM800L module. This can be seen in the output log as byte/bandwidth is higher than 0.
  2. When the D-link is setup correctly and Mavlink data is being transmitted from SIM800l, use tcpdump on port 14450 on the linux PC to verify that data is coming through the internet and firewall. (This is properly the critical part, depending on the network you have). If your D-link router is not connected directly to the internet, but instead to another router, then data will not arrive at the D-link router.
  3. Start the GPRS program and look at the log.

Good luck :-)

mohanbabi commented 3 years ago

thank you sir🙏. same way I did. I think my roter is problem. I will change my router.

thank you@KenLagoni sir

mohanbabi commented 3 years ago

@KenLagoni I am not getting a connection for the GPRS server. Maybe My ISP is blocking ports....... I will talk to those people and get it done.

Thank you @KenLagoni Sir

mohanbabi commented 3 years ago

@KenLagoni Sir please refer this document. may this will give us to counties communication.

https://docs.modalai.com/voxl-vpn/

it is just an idea, present I am using VOXL flight controllers

Thank you @KenLagoni Sir.

KenLagoni commented 3 years ago

A little history: When I started to develop a way to get Mavlink from drone to QgroundControl via the internet, I started with 2G which ended up with this GPRS project. After using this project for sometime, I wanted to add more bandwidth to get HD Video stream to server as well. That lead to the development of my other drone project: https://github.com/KenLagoni/OpenHD-LTE which uses LTE (4G).

@KenLagoni Sir please refer this document. may this will give us to counties communication.

https://docs.modalai.com/voxl-vpn/

In order to get a VPN (like OpenVPN) to work on the drone, you need a VPN client. The MKRZero is no were near powerful enough to implement a VPN client, and thus it can't be done. Normally when you use LTE you have some sort of embedded operating system which has the driver for LTE like the raspberry. The raspberry (and other Linux embedded computers) can be build to have a VPN client like OpenVPN which is what the link describes.

As I understand it the cloud service like AWS, only offers services (like OpenVPN), but what you need is a cloud service where you can install a ubuntu machine and the run the GPRS program in the cloud if you are not able to get the ISP to work. I do recall this is possible but I will have to look in to this and get back to you.

I could also try and setup a GPRS test server (I have a couple of them running normally) which you could use for testing.

KenLagoni commented 3 years ago

May I ask what you are aiming for? The GPRS project is normally best for low power drones and has better range to the network towers, but of cause you only get Mavlink data (no video). The LTE project offers better bandwidth and can also transmit HD video, but is uses more power and must be closer to the LTE network towers.

KenLagoni commented 3 years ago

I looked at my old notes, and I think you should be able to get a Linux server running in the cloud by using Azure: https://azure.microsoft.com/en-gb/free/virtual-machines/search/?&ef_id=EAIaIQobChMI1ZnN6cyo8gIVGuR3Ch3CBAslEAAYASAAEgLJj_D_BwE:G:s&OCID=AID2200274_SEM_EAIaIQobChMI1ZnN6cyo8gIVGuR3Ch3CBAslEAAYASAAEgLJj_D_BwE:G:s&gclid=EAIaIQobChMI1ZnN6cyo8gIVGuR3Ch3CBAslEAAYASAAEgLJj_D_BwE

This is only free for 30 days.

mohanbabi commented 3 years ago

@KenLagoni Sir, it is better to go with

@KenLagoni SIR Sir, please teach me how to work with the GPRS server. like how to make communicate with sim800l. I am trying sir but no use. It is worked with the Nokia router(this is not mine), not working with the D-link router(this is mine). Any help

Let's assume your setup is like this: The D-link router is your Internet router which is connected directly to the internet with a public IP: 103.248.211.75 (This is the IP you have specified in the SIM800L code according to the log you sent. You can verify this by going to www.myip.com from the Linux PC).

The GPRS server is running on Linux PC which is connected to the D-link router LAN (lets say the PC has local ip: 192.168.0.120 but you can use the one you have).

The D-link router must be set to forward traffic (port forward) on the TCP and UDP port which the SIM800l is using (port: 14450 according to the log).

It should look something like this: image

When this works, the SIM800l will sent UDP Mavlink to the D-link router, which will forward it to the PC running GPRS server. The GPRS server will output log when it starts and the when it start to receive data from the SIM800l.

This is how I would test it:

  1. Verify Mavlink data is transmitted from SIM800L module. This can be seen in the output log as byte/bandwidth is higher than 0.
  2. When the D-link is setup correctly and Mavlink data is being transmitted from SIM800l, use tcpdump on port 14450 on the linux PC to verify that data is coming through the internet and firewall. (This is properly the critical part, depending on the network you have). If your D-link router is not connected directly to the internet, but instead to another router, then data will not arrive at the D-link router.
  3. Start the GPRS program and look at the log.

Good luck :-)

this only, It is free way to go. Cloud also doing like workflow.

I am surprised about your's explanations....🙏...... after completing this (GPRS), I will start your's LTE code also.

Thank you @KenLagoni Sir

sorry, sir if any mistake on my side.😀

mohanbabi commented 3 years ago

@KenLagoni Sir for learning about coding you have any recommendations. Because it is defaulting while reading code. Based upon your diagram and instruction. Could please provide your guidance in this way.

Thank you @KenLagoni

KenLagoni commented 3 years ago

I am surprised about your's explanations....🙏...... after completing this (GPRS), I will start your's LTE code also.

The LTE project is still work in progress, so the ground station documentation is not complete but I'm working on it. Also I want to rewrite some of the H.264 video transporter coder, because it should be able to work better.

for learning about coding you have any recommendations. Because it is defaulting while reading code. Based upon your >diagram and instruction. Could please provide your guidance in this way.

I'm not sure what you are referring to, are you asking coding in general or do you have questions regarding the function of the code?. Also there are two sides, the MKRZero and the PC code.

FYI: I tested the Azure server and it is possible to get a Ubuntu linux VM server running so I will see if I can get the GPRS server to work.

mohanbabi commented 3 years ago

@KenLagoni sir

The LTE project is still work in progress, so the ground station documentation is not complete but I'm working on it. Also I want to rewrite some of the H.264 video transporter coder, because it should be able to work better.

I am waiting for testing of this code,

FYI: I tested the Azure server and it is possible to get a Ubuntu linux VM server running so I will see if I can get the GPRS server to work.

Do not consider my suggestions, those are just lazy man works. I will talk with my ISP or I will change my ISP first, and i will go for trial.

I'm not sure what you are referring to, are you asking coding in general or do you have questions regarding the function of the code?. Also there are two sides, the MKRZero and the PC code.

general coding only.

KenLagoni commented 3 years ago

Regarding coding in general, it really comes down to what you what to do with it. I have a background in electrical engineering in HW design, so naturally I like small microprocessors like the UNO and MKRZero. However there is also the server side (Like the GPRS server) which is not HW specific and then there is SW like apps and cloud. as I said I like working with microprocessors and building small devices, so I would recommend this, and for that C/C++ is the way to go. The Arduino is a very easy way to start, because there are so many people how can help you. Arduino does however hide all the low level programming to chip register, which is some of the charm, but it is possible to do in the Arduino sketch, but you can also import the Arduino to Visual Studio (I do this with larger project).

In short, start simple and work you way up. The UNO is very good for this, since it is much easier to read the Atmel328 datasheet compared to the ARM Cortex M0+ on the MKRZero.

Do not consider my suggestions, those are just lazy man works. I will talk with my ISP or I will change my ISP first, and i will go >for trial.

So I got the GPRS Server running on Azure server IP: 51.11.185.241 you should be able to set SIM800l to send to this IP and port 14450. Then you should be able to see the data with qgroundstation connection (TCP) to same IP with port 5760. Now it may be a bit buggy so try and get it right the first time :-)

I will consider adding this Azure server option to the description.

mohanbabi commented 3 years ago

Thank you for your valuable suggestions, now onwards I will start to flow your suggestions.

So I got the GPRS Server running on Azure server IP: 51.11.185.241 you should be able to set SIM800l to send to this IP and port 14450. Then you should be able to see the data with qgroundstation connection (TCP) to same IP with port 5760. Now it may be a bit buggy so try and get it right the first time :-) I will consider adding this Azure server option to the description.

I will do this at night. I do not have boards and drones now.

Thank you @KenLagoni Sir

mohanbabi commented 3 years ago

image

mohanbabi commented 3 years ago

image

@KenLagoni Sir, I got a connection. The only pending is my side is to turn on drone along with sim800L. 😀 I am so happy sir. Thank you @KenLagoni sir for your support.

KenLagoni commented 3 years ago

I got a connection. The only pending is my side is to turn on drone along with sim800L.

Perfect! - let me know how it goes.

This project is still in development, so let me know what to improve or new features.

mohanbabi commented 3 years ago

image

Sir why I am not getting MAV link data to MKR zero from Pixhwak.

KenLagoni commented 3 years ago

Ensure the wiring is correct according to picture and baudrate on Pixhawk is set to 57600. Set the serial protocol to Mavlink v1.

mohanbabi commented 3 years ago

yes Sir All are correct. I am unable to identify my problem. baud rate for pixhwak is 57600 and mavlink1 is seleted

KenLagoni commented 3 years ago

yes Sir All are correct. I am unable to identify my problem. baud rate for pixhwak is 57600 and mavlink1 is seleted

Can I see your wiring?

mohanbabi commented 3 years ago

Can I see your wiring?

Ok sir 1 munite

mohanbabi commented 3 years ago

DSC07053

mohanbabi commented 3 years ago

Pixhwak GND, ZERO GND, SIM800 GND are connected to the Battery -ve terminal.

KenLagoni commented 3 years ago

So I may have made an error in my documentation... Can you try and move the Pixhawk serial to these pins: Pixhawk TX-> MKZzero pin 13 (RX) Pixhawk RX<- MKZzero pin 14 (TX)

Sorry a can't test this from where I am now, but looking at the code I think this is correct.

Let me know I this works

mohanbabi commented 3 years ago

SIR @KenLagoni

mohanbabi commented 3 years ago

Pixhawk TX-> MKZzero pin 13 (RX) Pixhawk RX<- MKZzero pin 14 (TX)

at this step i made mistake below my connection is there, I used to make these connections in the Picture. Pixhawk TX-> MKZzero pin 8 (RX) Pixhawk RX<- MKZzero pin 9 (TX)