I want use MQtt Protocol as Messing protocol. I want to port the Mqtt Library on Microcontroller TMS470(Texas Instrument) with CCS Compiler. Since I am new to this Protocol, Can any body suggest me how use this protocol using the GPRS module. I made some study on MQtt. But i don't know how to start. After Opening the TCP/IP, how to publish or subscribe the data. Typically how to port the Library. And where i will get a library
相关问题
- Multiple sockets for clients to connect to
- What is the best way to do a search in a large fil
- glDrawElements only draws half a quad
- Index of single bit in long integer (in C) [duplic
- Equivalent of std::pair in C
You can use the Paho embedded client library: https://eclipse.org/paho/clients/c/embedded.
Using this library you only have to implement the logic for writing and reading from your GPRS module (Network) and time management (Timer).
As an example you can look at my MQTT library for Arduino: https://github.com/256dpi/arduino-mqtt. There are also more examples in the Paho embedded client repository.
I have similar problem, I'm using STM32F405 and GPRS module( Quectell M95 ). I can't receive MQTT package correctly. As my experience, With PAHO embedded C library , I can publish a test Message to iot.eclipse.org.
Benjamin MQTT with CC3200 example is very good to understand concept. Watch the video tutorial.
http://blog.benjamin-cabe.com/2014/08/26/mqtt-on-the-ti-cc3200-launchpad-thanks-to-paho-embedded-client
As I understand, PAHO embedded C library serilaze MQTT package and you need to implant transport method to library. ( Send /Recive / Connect / Disconnect )
This is my transport_sendPacketBuffer() function, It just puts buffer to gprs module. Don't use printf. cause, MQTT package can be contain 0x00 , or any type of data. "buflen" is calculated by library.
Before you transport_data You need to connect socket with AT Command, There are several methods to connect. It depends on your GSM module AT+Command / TCP documantation ( Transparent / Multiple Connect ) If you have an library for your GSM module it will be help much too.
This is simple Quectel M95 TCP socket connection command, AT+QIOPEN
If you can handle recive message I will glad to hear it.