web service communication over nRF24L01 - arduino

I have two peaces of nRFO24L01, one of them is connected to arduino and second one is connected to RPi. For communication between them I used this library https://github.com/tmrh20/RF24 and this communication working very good. Now I want to have web services on RPi which have to be able to communicate with arduino through the nRF24L01. The best option should be some java web services on tomcat server but I can't manage to find some kind of wrapper which will provide me easily connection between c++ code from mentioned library and web services. Is there any solution for this?
For communication between arduino and RPi I used getting started example from mentioned library from github.

See the RF24Ethernet lib from the same guy:
http://tmrh20.github.io/RF24Ethernet/

Related

ESP32 + Mongoose server + MQTT broker and client

I have a system already working, which consist in a Mongoose web server running in a ESP32. It is also capable of publishing messagges trough MQTT, using Mongoose's mqtt libraries, when connected trugh an external MQTT broker. The idea is that there could be many of those systems, let's say 5 units, connected to the same LAN whith an extra hardware running a mqtt broker.
The broker is the one who manage some features of the individual units.
The thing is, what if the broker goes down? Or, if the broker is not in the LAN but is connected through internet, what if the internet connection goes down?
If that happens, the idea is that one of those units became a mqtt broker, so it can manage its own features and also other unit's.
In that way, I would have one unit working as a broker (only with basic functionalities) but also as a client.
I would like to know if anyone of you have already worked with a similar setup, or what do you think about it.
Any other idea?
I know there are Mongoose libraries to run a MQTT broker in the device, that wouldn't be an issue... the thing is... Isn't it better to setup an HTTP communication between the units, since they are all already web servers?

How can I use mqtt to connect hono to ditto?

Is it possible to use mqtt to send data from a device (arduino in my case) to hono and then send these data to ditto via mqtt?
in my case I have arduino that send a value via mqtt to hono, but now i need the data to be received by ditto.
For the moment i have only arduino that sends data to hono via mqtt.
Eclipse Ditto can either consume messages directly from an MQTT broker using MQTT 3.1.1 or MQTT 5:
https://www.eclipse.org/ditto/connectivity-protocol-bindings-mqtt.html
https://www.eclipse.org/ditto/connectivity-protocol-bindings-mqtt5.html
Or, utilising Eclipse Hono as device connectivity layer, consume messages via Apache Kafka or AMQP 1.0 (which Hono uses for "northbound" applications ingesting telemetry data).
If you need Eclipse Hono, I suggest to have a look at the "Cloud 2 Edge" package in the Eclipse IoT Packages project which already automatically sets up and configures both Eclipse Hono and Eclipse Ditto to work with each other:
https://www.eclipse.org/packages/packages/cloud2edge/
If you only need to send data via MQTT, I would suggest to use an MQTT broker (like Eclipse Mosquitto) as this simplifies the setup a lot.
If you have requirements towards supporting multiple IoT protocols or massive scalability requirements, Eclipse Hono is a good choice.

Using MQTT between Raspberry Pi, Arduino and JavaScript

A mate and I are doing a project at the moment that hosts a webpage on a raspberry pi which I would like to send a message via MQTT to the arduino which reads sensors and then sends the values back to the pi to be displayed on the web page.
I am hoping to use Mosquito on the pi as a broker and treat the arduino and the webpage as clients.
I am just having a lot of trouble working out how it all fits together.
A lot of examples I have seen use web sockets and node.js and MQTT.io and I'm just so confused..
Could someone please help me piece it all together and explain how everything fits and what it does?
Thanks in advance!
Websockets allows a web browser to open a bi-directional communication pipe to a server.
For websockets to work you need a websocket enabled mqtt broker. At the moment you have to install this seperately, some examples of what is out there are here. Mosquitto will have websockets enabled in the next version, 1.4, you can compile it if you wish.
An example of what can be done, and what I am doing atm with mqtt and websockets is;
publish temperature data to mqtt broker from an arduino.
subscribe to the topic that the arduino is publishing to and populate the data into a mysql database using python scripts.
have a live website subscribe to the topic and show the current temperature as a line graph.
We did tutorials on building applications with MQTT and websockets in the past. Slides (+ Code) can be found on Slideshare.
If you're interested in how MQTT over websockets works in detail, this blog post may help you. Also, a full example websockets/MQTT application tutorial can be found in this blog post.

Control development boards from web interface

I have multiple Raspberry Pi/ Beagle Board/ Panda boards connects to my web server (clouding). Then I want to my clients control the board's GPIO from web interface. I have read many examples on the Internet but in those example the web server is inside every boards.
So, Could anyone help me to use just 1 web server(clouding) outside all of boards to control board's GPIO? Thanks!
You could use NexusDataLink to get your boards connected. This data communication framework allows one to link several devices or systems - the server process may run anywhere. Optionally a REST interface is generated per linked device based on an XML file.

PIC32 bluetooth

I want to implement bluetooth communication on my final bachelor project, but I'm having a lot of doubts.
One of the requisites of this project is to have a Java application that can talk to the micro via Bluetooth. After a lot of research, I've found one that I think it's very good with a SPP profile, but I still have a lot of questions about it:
All the bluetooth on a PC implements the SPP profile stack?
If you need to develop a Java application that runs on every PC that implements the SPP stack, how would you do it?
We started by trying to use BlueCove and JavaBluetooth.org API, the first one runs great but I don't know if it's just on my PC and the second one sends an error (Stack not initialized). Which one would you use, and why?
We decided to buy this bluetooth module, from Sparkfun, any comments for those of you who already use it?
Thanks
I used a similar product for my senior design project from Sparkfun (RN-41): http://www.sparkfun.com/products/10559
It worked right out of the box as a simple UART. This allowed my team and I to develop a simple C# application that used the .NET SerialPort class (System.IO.Ports) to communicate between an MSP430 and the PC application we were developing. If streaming data is all you care about, these Bluetooth modules work great. Java implements a similar SerialPort class for RS-232 communications. Don't forget that Bluetooth was developed to replace a serial cable.
I hope this answer helps! Good luck.
I personnally achieved to use the Sparkfun's bluesmirf devices to communicate with my own Java application (an Eclipse plug-in). I tested it successfully under Windows, MacOS & Linux based systems.
I used the RXTX Java library to connect to the corresponding serial port once the Bluetooth devices were paired. Under Linux I even achieved to configure rfcomm to automatically pair the Bluetooth devices on demand.
From my experiment I encountered some stability issues... Sometimes it simply fails to connect to the given port even if it exists or refuse to reconnect on it. Sometimes it hangs the whole system...
I never found any good solution to fix those issues that seems to be completely system dependent. I would be interested if any one achieved to use it properly...

Resources