Comments (10)
Hello Johan. Thanks for opening this issue. Last year I started adding threading into the client for the FreeRTOS port. I think that continuing and optimizing this approach for Linux and FreeRTOS is worth exploring, which I will try to do this week.
On the callback option, can you explain what you mean by "I would not require this to be supported by the network interface"? I'm not sure I understand.
from paho.mqtt.embedded-c.
Thanks, I'm looking forward. If you need testing or anything, let me know.
I mean that we shouldn't require socket callback support in the network interface (like NetworkInit()
), because it may not be supported. I think there's better support for threading than for socket callbacks, but I'm not an embedded operating system's expert.
from paho.mqtt.embedded-c.
BTW, in my particular use case, I can work with FreeRTOS.
What can I do to make this working using threading?
from paho.mqtt.embedded-c.
Hi Johan. Sorry I've been distracted by other work, including the Paho C and embedded MQTT-SN clients. I'll try to get to this issue this week. I can work with Linux in the first place - that would be easier for me anyway. I intend to make it work the same way on Linux and FreeRTOS. You did say that you use another OS - was it OpenWRT? Are you using the Linux interface at the moment?
from paho.mqtt.embedded-c.
@icraggs would be great. I'm very much looking forward. We're using a PIC32 with Microchip Harmony but turns out that it runs FreeRTOS. I'm currently using Linux indeed; it should there as well in my use case.
from paho.mqtt.embedded-c.
Can you tell me the version of FreeRTOS used? And what TCP stack?
from paho.mqtt.embedded-c.
We're using FreeRTOS v8.x, and a TCP/IP library from Microchip Harmony. The latter is kind of exotic but we've got it working. It's doable to implement the network abstraction in there and I'll contribute it to this project.
from paho.mqtt.embedded-c.
@icraggs any progress on the async client? I agree with @johanstokking that the thread solution (as opposed to callbacks) is better supported in the RTOS space. We use FreeRTOS v9.0.0 with 2 different TCP/IP stacks, SimpleLink on CC3200 and Cyclone/TCP on BCM43362. Threads can work in both environments, callbacks not.
In a current CoAP based implementation we have used slightly different roles for the 2 threads.
Receive/read thread: receives all incoming requests (GET/PUT/POST/DELETE) and responses (ACK etc) and completely act on these up to the point (if required) of producing a response packet. At this stage an entry is put into a message queue for the transmit thread.
Transmit/write thread: takes as input entries from it message queue and transmits these. Handles all retransmission (if required) and correctly frees up (if any) dynamically allocated memory buffers.
In this scenario the configuration can be tuned based on resources (available memory), performance (thread priorities for receiving and transmitting volumes) and various other considerations.
We would like to start a migration from CoAP to MQTT (with paho mqt) but having asynchronous client communications is a must.
Thanks
from paho.mqtt.embedded-c.
@ammaree I got it working, see https://github.com/thethingsnetwork/paho.mqtt.embedded-c
I'm planning a pull request. We changed the code formatting though, which was very inconsistent, so loads of diffs, but you'll get the point.
from paho.mqtt.embedded-c.
@johanstokking As we discussed, please make a pull request. I'm happy to take some time to figure out how to merge.
from paho.mqtt.embedded-c.
Related Issues (20)
- Messages are not retained even if the flag is set to true HOT 2
- Suspected bug with MQTTYield() / cycle()
- Performance problem related to cycle() and MQTT_TASK HOT 2
- Is there a limit on the amount of bytes the payload must be in the publish message? HOT 6
- Are there any plans to migrate to exact-width integer types? HOT 13
- isTopicMatched() does not behave correctly for filter that terminates with wildcard /# HOT 2
- Why use `enddata - curdata` instead of `mylen` in `MQTTDeserialize_ack()`?
- MQTTPacket_decode() doesn't present errors when it should HOT 1
- Does this library support mqtt v5? HOT 6
- Memory corruptions when casting enum to `int *` HOT 1
- Client never closes socket HOT 2
- Move includes to a subdirectory HOT 3
- keepalive failed by calling MQTTYield with short timeout and short interval. HOT 4
- Potential OOB Writes in eclipse/paho.mqtt.embedded-c
- PlatformIO's last release outdate HOT 2
- Compile error when compiling MQTTV5 HOT 1
- Library linking issues HOT 2
- Facing errors while building on windows
- MQTTPacket V5
- Example MQTT Client C use SSL
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from paho.mqtt.embedded-c.