Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] Embedded MQTT C Client

Ian,

Indeed this is similar with Spark Core: I need to create a library on
GitHub put all the files in the repo and from the Spark Core IDE this can
be imported fyi https://github.com/spark/uber-library-example

Guy


On 24/09/14 13:52, "Ian Craggs" <icraggs@xxxxxxxxxxxxxxxxxxxxxxx> wrote:

>Guy,
>
>I created a target in the Makefile to build a library for the Arduino.
>
>make arduino
>
>creates an arduino.zip (not a good name I know, I wasn't thinking at the
>time) in build/output/arduino, which can be imported into the Arduino
>IDE.  It results in a library called MQTTClient, using all the C++
>headers and C files required.  This works for the Arduino, including C
>files.  I would expect it all to work for the Spark too (apart from if
>the Ethernet or Wifi APIs are different from the Arduino, which seems to
>be the case).
>
>Ian
>
>On 09/24/2014 12:42 PM, Guy Dillen wrote:
>> The Spark Core IDE (in the cloud) has only support for .h and .cpp
>> extensions; the C source files under MQTTPacket/src have all the .c
>> extension for C source code; can I use the cpp extensions with these
>>files
>> or does this not work? In that case I probably need to create a library
>> for the Spark Core.
>>
>> Thanks.
>> Guy
>>
>> On 24/09/14 11:19, "Al Stockdill-Mander" <asm@xxxxxxxx> wrote:
>>
>>> The C++ .h files for the arduino files include implementation for a
>>> specific platform, you'll also need all the files from MQTTClient/src
>>> (although MQTTClient.h imports FP and MQTTLogging) as well. But the
>>> WifiIPStack.h is for the arduino Wifi shield only, I don't think it
>>>will
>>> work with the Spark Core, but you should use it as a basis to create,
>>> for example, SparkTCPClient.h. In WifiIPStack.h you can see there is a
>>> private WifiClient, the Spark version looks to be TCPClient, your class
>>> also needs to implement the read() and write() functions. I'm afraid I
>>> don't have one of these devices to do any direct dev myself.
>>>
>>> Thanks,
>>>
>>> Al
>>>
>>> On 24/09/14 09:47, Guy Dillen wrote:
>>>> Hi All,
>>>>
>>>> I just started trying to port the MQTTClient to Spark Core. As you
>>>> mentioned in previous post I should try with the Arduino embedded C++
>>>> library.
>>>> So I suppose I need to import the header files under
>>>> ../MQTTClient/src/arduino Countdown.h, and WifiPStack.h (not
>>>> EthernetStack.h since Spark Core hasn’t ethernet=LAN) on-board and all
>>>> source code under ../MQTTPacket/src/ except the ones (used by servers)
>>>> mentioned by Ian: QTTUnsubscribeServer.c, MQTTSubscribeServer.c and
>>>> MQTTConnectServer.c?
>>>>
>>>> Probably a newbie-stupid question: under ../MQTTClient/src/arduino i
>>>> only
>>>> see header (.h) files, there are no implementation (.cpp) files, I
>>>> suppose
>>>> the .h files use the implementation/libraries provided by the Spark
>>>> Core,
>>>> is that correct?
>>>>
>>>> Thanks.
>>>> Guy
>>>>
>>>>
>>>> On 23/09/14 15:31, "Guy Dillen" <guy.dillen@xxxxxxxxx> wrote:
>>>>
>>>>> Al thanks. i¹ll give it a try.
>>>>>
>>>>> On 22/09/14 18:05, "Al Stockdill-Mander" <asm@xxxxxxxx> wrote:
>>>>>
>>>>>> The CC3200 code relies on the SimpleLink libraries provided by TI.
>>>>>>I'm
>>>>>> not familiar with the Spark Core but it looks like it's designed to
>>>>>>be
>>>>>> similar to the arduino in terms of IDE and libraries. It will almost
>>>>>> certainly be easier to port the arduino embedded C++ library. If you
>>>>>> look in the repo at the moment under arduino there is
>>>>>>EthernetStack.h
>>>>>> and WifiIPStack.h, these provide the implementation specifics for
>>>>>>the
>>>>>> Ethernet or WifiShield on an arduino.
>>>>>> Looking at the Spark site there seem to be most of the equivalent
>>>>>> functions (.connect() .available() .write()) under TCPClient,
>>>>>>although
>>>>>> it doesn't seem to have a readBytes() so you'd have to use a loop to
>>>>>> read() a byte at a time into the buffer.
>>>>>> The current Countdown.h in the arduino directory should work as is
>>>>>>as
>>>>>> it
>>>>>> only uses millis() which also seems to be on the spark core.
>>>>>>
>>>>>> Al
>>>>>>
>>>>>> On 22/09/14 16:44, Guy Dillen wrote:
>>>>>>> Hi Al,
>>>>>>>
>>>>>>> Thanks.
>>>>>>> Besides the TI CC3200 I also would like porting/using the library
>>>>>>> with
>>>>>>> my Spark Core's (www.spark.io) based on that are based on the ARM
>>>>>>> cortex
>>>>>>> M3 microprocessor. I suppose, since I'm no expert C developer, can
>>>>>>>I
>>>>>>> use
>>>>>>> the same source code as for the CC3200? Any help/suggestions
>>>>>>>welcome.
>>>>>>>
>>>>>>> Thanks.
>>>>>>> Guy
>>>>>>>
>>>>>>> Sent from my iPad
>>>>>>>
>>>>>>>> On 22 Sep 2014, at 17:13, Al Stockdill-Mander <asm@xxxxxxxx>
>>>>>>>>wrote:
>>>>>>>>
>>>>>>>> Guy,
>>>>>>>>
>>>>>>>> Copy the MQTTClient.c/h and MQTTCC3200.c/h files to wherever is
>>>>>>>> suitable for the app you're working on. You only need to import
>>>>>>>>the
>>>>>>>> MQTTClient.h, but you have to edit MQTTClient.h to #include the
>>>>>>>> platform specific implementation it is to use. Currently there is
>>>>>>>> only
>>>>>>>> the CC3200 code, so add a #import "MQTTCC3200.h" to the end of the
>>>>>>>> #includes in MQTTClient.h
>>>>>>>> I realise that there is a distinct lack of documentation/samples
>>>>>>>>for
>>>>>>>> the C specific embedded client, I'll try and get something up
>>>>>>>>asap.
>>>>>>>> In
>>>>>>>> the mean time please ask any other questions here and I'll do
>>>>>>>>what I
>>>>>>>> can to help.
>>>>>>>>
>>>>>>>> Al
>>>>>>>>
>>>>>>>>> On 22/09/14 14:56, Guy Dillen wrote:
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> I mentioned the embedded C implementation has a specific C (and
>>>>>>>>> even
>>>>>>>>> more specific) CC3200 implementation.
>>>>>>>>> I¹m confused as what sources to use; in the example form Benjamin
>>>>>>>>> Cabé
>>>>>>>>> all source code under MQTTPacket was imported in the CC3200
>>>>>>>>> microcontroller project. Should I still import these sources or
>>>>>>>>> only
>>>>>>>>> the
>>>>>>>>> sources under
>>>>>>>>> org.eclipse.paho.mqtt.embedded-c-master -> MQTTClient-C -> cc3200
>>>>>>>>> ->
>>>>>>>>> MQTTCC3200.c and MQTTCC3200.h?
>>>>>>>>>
>>>>>>>>> Thanks.
>>>>>>>>> Guy
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> _______________________________________________
>>>>>>>>> paho-dev mailing list
>>>>>>>>> paho-dev@xxxxxxxxxxx
>>>>>>>>> To change your delivery options, retrieve your password, or
>>>>>>>>> unsubscribe from this list, visit
>>>>>>>>> https://dev.eclipse.org/mailman/listinfo/paho-dev
>>>>>>>> _______________________________________________
>>>>>>>> paho-dev mailing list
>>>>>>>> paho-dev@xxxxxxxxxxx
>>>>>>>> To change your delivery options, retrieve your password, or
>>>>>>>> unsubscribe from this list, visit
>>>>>>>> https://dev.eclipse.org/mailman/listinfo/paho-dev
>>>>>>> _______________________________________________
>>>>>>> paho-dev mailing list
>>>>>>> paho-dev@xxxxxxxxxxx
>>>>>>> To change your delivery options, retrieve your password, or
>>>>>>> unsubscribe
>>>>>> >from this list, visit
>>>>>>> https://dev.eclipse.org/mailman/listinfo/paho-dev
>>>>>>>
>>>>>> _______________________________________________
>>>>>> paho-dev mailing list
>>>>>> paho-dev@xxxxxxxxxxx
>>>>>> To change your delivery options, retrieve your password, or
>>>>>> unsubscribe
>>>>> >from this list, visit
>>>>>> https://dev.eclipse.org/mailman/listinfo/paho-dev
>>>>>
>>>>
>>>> _______________________________________________
>>>> paho-dev mailing list
>>>> paho-dev@xxxxxxxxxxx
>>>> To change your delivery options, retrieve your password, or
>>>>unsubscribe
>>> >from this list, visit
>>>> https://dev.eclipse.org/mailman/listinfo/paho-dev
>>>>
>>> _______________________________________________
>>> paho-dev mailing list
>>> paho-dev@xxxxxxxxxxx
>>> To change your delivery options, retrieve your password, or unsubscribe
>> >from this list, visit
>>> https://dev.eclipse.org/mailman/listinfo/paho-dev
>>
>> _______________________________________________
>> paho-dev mailing list
>> paho-dev@xxxxxxxxxxx
>> To change your delivery options, retrieve your password, or unsubscribe
>>from this list, visit
>> https://dev.eclipse.org/mailman/listinfo/paho-dev
>
>-- 
>Ian Craggs
>icraggs@xxxxxxxxxx                 IBM United Kingdom
>Paho Project Lead; Committer on Mosquitto
>
>_______________________________________________
>paho-dev mailing list
>paho-dev@xxxxxxxxxxx
>To change your delivery options, retrieve your password, or unsubscribe
>from this list, visit
>https://dev.eclipse.org/mailman/listinfo/paho-dev




Back to the top