How to connect Arduino-Uno IOT recipe to MQTT over WiFi WPA - wifi

This IOT Foundation recipe for Arduino Uno provides a way to connect to the MQTT server on Bluemix via the Ethernet client, but how can I do this using the Arduino Wifi shield with WPA secured wifi connection.
https://developer.ibm.com/iotfoundation/recipes/arduino-uno/

See this example:
https://github.com/remkohdev/arduino/blob/master/iotfoundation/recipes/arduino-uno/quickstart_with_wifi.ino
Use the Wifi package
include
Set the WifiClient to the IPStack
WiFiClient c;
IPStack ipstack(c);
and then build your connection as in source code.

Related

How to connect an existing MQTT broker with Thingsboard

I have a site using html, php, javascript and css in which I add my data from IOT devices using MQTT broker. Now I want to update it and I want to connect my MQTT broker with Thingsboard MQTT to manage the same data from both platforms. How can I succeed the communication between the two MQTT brokers?
You have to use the "Thingsboard IoT Gateway". In the Gateway you can set your external MQTT Broker and connect it over the Gateway to Thingsboard. I think thats the only solution. Just follow the instructions.

how to connect and subscribe from cumulocity to MQTT broker

I have an external broker us Apache Active MQ-MQTT.
I have a cumulocity IoT platform on the cloud.
I don’t understand how I can connect and subscribe my cumulocity application to broker MQTT.
There is no built in feature that would enable you to connect Cumulocity to an external MQTT broker. You could however create your own microservice that does this for you.

Connect 3g obd II to azure iot hub

I am new to azure iot and I am trying to connect a 3g obd 2 tracker to my account azure iot hub. I found an example to connect the obd to local gateway (phone) via bluetooth or wifi but I want the tracker to be completely independant from any local gateway.
Is there a tutorial or documentation to help me getting starting with connecting 3g teacker to azure iot
There is no tutorial specifically on 3G trackers. What is the OS running on the device? You can always use the device SDK to connect to IoT Hub directly if your device is IP capable.

Paho-mqtt connect via ppp0

I am working on an embedded linux based device that runs ubuntu. Now the device driver for the wifi is really crappy so I cannot create a hotspot so this device connects to another device which is running a hotspot. Now I am connecting to that device for some input but at the same time connecting to internet to send mqtt message using paho mqtt in python via a gsm modem. The modem connect to internet using pon command and it works nicely. But when both connections are running, paho-mqtt cannot connect to internet anymore. pinging using -I ppp0 works fine. I tried to bind ppp0 ip address to paho-mqtt client using the bind_address argument but it does not work. How to resolve this issue?

Allow access for MQTT on Ubuntu Server running on Azure

I have a Ubuntu Server 14.04 running on an Azure machine. I have installed MQTT broker on this Ubuntu Server. Moreover, I have multiple ESP8266 devices that are assumed to subscribe and publish to different MQTT topics via this broker. Now my problem is that when I connect two devices to Broker, one for receiving data and other for publishing, they work fine but as I try to connect one more device to broker all devices stop working and my ESPs just display this message "trying to connect Broker" over and over again.
(In endpoints of my machine I've added 1883 for HTTP, 443 for HTTPS and 22 for SSH)
My question is how I can allow multiple devices to communicate with MQTT broker running on Azure broker?
All client devices needs to have unique client ids. The situation you have described sounds exactly like what happens if all your esp8266 devices have the same hardcoded client id
MQTT clients get clientID as parameter before connection to provide uniqueness. ESP8266's has unique ChipID. So use it to hit the issue.
Here the example for Arduino firmware :
WiFiClient wifiClient;
PubSubClient mqttClient(wifiClient);
mqttClient.setServer(MQTT_BROKER, MQTT_BROKER_PORT);
String clientId = "IoTDevice-" + String(ESP.getChipId());
mqttClient.connect(clientId.c_str(), MQTT_USERNAME, MQTT_KEY);
Here is NodeMCU firmware example :
mqtt_cli:connect(MQTT_BROKER, MQTT_BROKER_PORT, 0, CALLBACK_FN);
mqtt_cli = mqtt.Client("IoTDevice-"..node.chipid(), 120, MQTT_USERNAME, MQTT_KEY);

Resources