amg
amg

Reputation: 137

How to send MQTT 'Publish' packet using (GPRS )sim900 modem?

I'm using sim900 modem with raspberry pi, I'm able to connect to server using AT command for TCP, but when I try to send mqtt Publish packet as follow(I used tcpflow to get this packet from mosquitto library):

Serial.print("0");
Serial.print("0x10");
Serial.print("0x0");
Serial.print("0x8");
Serial.print("ABC/XYZ");
Serial.print("HELLO");
Serial.print("0x0");

it doesn't work.

Upvotes: 1

Views: 4438

Answers (1)

amg
amg

Reputation: 137

Follow this tutorial to connect internet on Raspberry Pi using SIM900 modem. Download 'sakis3g.gz' from Here. Use Mosquitto client library for MQTT pub/sub functionality. It worked for me :)

Steps to enable internet on 'Raspberry pi' using SIM900 :

  1. Enter this on terminal sudo apt-get install ppp isc-dhcp-server usb-modeswitch

  2. Then download sakis3g from Here

  3. Unzip package using gunzip sakis3g.gz

  4. Make file executable chmod +x sakis3g

  5. Run sakis with GUI option sudo ./sakis3g --interactive

Now follow onscreen instructions. Good luck! :)

Upvotes: 2

Related Questions