MQTT Dash Phone Tool Setup Help


#1

Hi
Does anyone use or know how to set up the credentials from Cayenne Dashboard in the “MQTT Dash” phone tool ?
Here are some screen grabs…

I am not sure where the details per device go or the exact directory structure and file name. I suspect as usual is too simple or obvious for me to get the hang of. I have maanaged to created virtual gadgets that do nothing on the phone from Cayenne server / 1883 but am missing the link of what bit of information from Cayenne Dashboard setup devices name or unique code goes where. Some things have to be unique and other bits have to be copied exactly.

But would be very nice as I have used MQTT Dash on the phone for a serparate MQTT direct project.

Thanks

~ Andrew


#2

I was going through some old tabs and just came across your post. In those screen shots are you already connected and getting data from Cayenne, or is that some other service? As far as I know you should be able to just plug in the correct credentials and it should work. I have used Node-RED in that way here I have some details on what each part of the credentials do there as well.


#3

I was working with someone else the other day and we were still trying to get this useful phone tool to connect with the Cayenne settings without success. Not sure about text or numeric formats etc.

The usual case of it being Very obvious,to those used to the terms and various/etc but not ‘getting it’ sorry… One example of typical monitoring settings needed and one example of changing an Output from the phone would be great thanks if anyone can look at it. This tool is well worth checking out as a MQTT Utility. Suggest or recommend add it to the section on manual publishing etc.

I am mainly interested in using this as a learning tool or sort of utility. MQTT Dash looks a greatt intermediate tool for test and demo.

I have managed to set user and pword and use the cayenne as the site to demo what MQTT can do but we have not managed to connect andy devices to projects so far.

Using MQTT remote access we are developing HC-12 ‘km backhaul’ IoT into Pi for environment and ‘wildlife’ monitoring at present with schools. his works well and looks like remote instruments can be set up km away from the Pi and we are working up techniques for battery powered for year + off 3xAA alkaline.

Last week with 14 students we placed 7 river level and high res temperature monitoris in place.

2018 we hope to use this in a vineyard as a combined R&d / IT education project with a shouth island school.

Any help, quick screen grab of typical MQTT Dash settings for a Cayenne typical feed would be Greatlay apreciated.

Thanks !
~ Andrew


#4

I have a page here that uses the standard Paho library to send values from a DHT11/DHT22, does that help give you a general idea of making a connection to the Cayenne servers? There’s also the Python Cayenne MQTT library which makes it easier yet to connect.


#5

Thanks for links. I have been using the information and resources and have several Pi forwarding MQTT from GPIO serial connected devices over long range radio.

Two tings here really…

The first key bit of information and example I am missing is understanding how to translate this to using the handy phone utility MQTT Dash. I have limited experience of using MQTT so just need some graphical examples or specific text example of what goes into which box. E.g. what gets put into the configuration screen here:

I have the pre screen sorted that sets up the
Name (can this be anything ?)
Address mqtt.mydevices.com
port 1883
Username from settup
user password from settup
Client ID (must this be unique per phone ? )

I think I have a pretty sound understanding of the structure of MQTT and pub / sub etc. It is just how to make the folders and exact formats within the detail of filling out the boxes I am missing.

The documentation and data types is good and extensive but the way the information is put into python In the phone here for MQTT ( and python examples ) I am still working on making the connection. I reaslise seems to be exact :slight_smile:

The documentation section is good and covers the 4 main methods and code examples Extensively. The Manually Publish section is good. I guesse I am asking for at least a starter along the same lines on Dash MQTT.

The Documentation section I feel would benefit greately from having a section with just a few very basic few lines of python for a minimum of Pub-Sub Digital-Alalogue. Just txt.py would be fine. No need for extensive video and screen captures unless time and space permit. At present we seem to be diving in and out to one off various third party project examples that then need reverse engineering ?

I have python working and several projects with multiple variables passing easily but all variables in coming at present are degree c data type :slight_smile: I.e. some simple py lines of client.celsiusWrite(8, data) alternative data types. I have atempted without success to change celcsius in the python so far but not ‘cracked it’ yet. ( Or the tpye can not be changed once already added and config’d on the dashboard).

The way Cayenne accepts my present pythin examples and faithfully and Very reliably sets up new devices is sheer magic ! Well done on that front.

The Documentation is extensive and ‘good’ but a little bit hidden wayyy down the bottom ?. New sub section pehaps / edit ?

And perhaps just a few lines of pi py please ?

Thanks :slight_smile:

~ Andrew


(Photo from Zealandia for those planning a trip to middle earth / Wellington nz you can see this in action as well as on line soon…)


#6

I Have been poking about and found:
…home/pi/Cayenne-MQTT-Python/cayenne/client.py
So this contains a limited number of 7 data types and 14 sets of Units. If I want to make my python script do more clever things do I look up the Supported Data Types and edit in and update the client.py ?
Another thing…
I am posting data to cayenne through the Pi easily and note there seems to be a rate Below where the contact is maintaned. Is this set by Cayenne end MQTT gateway / server or set to some nominal number of minutes some place else ?
Thanks
~ Andrew


#7

Here is a list of data types explained. They are all defined on the server so adding to that file won’t get you anything new.

client.loop() needs to be called as often as possible or you will get timeouts. It is a server set value. Maybe @rsiegel would know what the timeout length is? If you read through the DHT11/22 link I posted above you’ll see the troubles I was having with timeouts. Luckily I was using the standard Paho client so I was able to call mqttc.loop_start() which starts a new thread that runs independent of the main thread. My script was getting caught up trying to get a valid reading from the DHT sensor and hitting the timeout.


#8

Thanks.

I am finding the system quite responsive reasonable for the student instruments that send in channel addressed simple serial data packet using a protocol I call Cicadacom. This allows uAmp idling devices with a year + battery life to write over 433MHz radio using ultra light data addressed and Check Summed data packets. So I am posting sliced and diced serial data packets into the system over ttyAMA0 rather than the DHT sensor direct connected sensor. I am a complete beginner with.py but have managed to hack something I call MQTT_Serial.py so far that interacts with client.py. Using this I can set up a logical addressing schema that takes data from multiple instruments remote from the Pi from the Cicadacom data stream ‘chirrrrups’ validate, slice, dice and post data into separate channels. This is working well so far.

Timeout testing…
Timeout is fine. It seems to be when it gets past a few minutes but that is not an issue. It picks up again on fresh data. It stops posting all together if data is separated by a few 10’s of minutes but seems to recover again by itself. Great !
Here is a links to some temporary project variables running on two Pi 3:
https://cayenne.mydevices.com/shared/5a11e248edbe7f0c6d6e9d5f

As much as possble, I am setting this up for the most direct educational situation. I am setting up lab sheets I am trying to keep to the excelent documented BYOD minimum settings. The client.py is working well so far. I just saw the limited 14 units and 7 types in the client.py script and assumed these were all I had to work with. Can I edit the client.py and ‘install’ some more data types acceptable to the bigger list acceptable to the cayenne server ?

Thanks for links and ideas. I will keep tinkering and see if I can extend and tap into that pretty impressive range of Data Tayes and Units !

~ Andrew


#9

The data types in client.py are just special functions that you can use to send those specific data types while providing less parameters. If you click this link it will explain the difference between virtualWrite and something like celsiusWrite. I’ll also quote it below:


#10

Okay…
Makes sense now
Have just read page three and back of client.py and all making sense now
Thanks :slight_smile:
~ Andrew


#11

Excellent! Let me know if you need anything else.


#12

Glad Adam was able to help out here @picaxe. Really hope you can share this project when it’s done too!

Oh and good to see you around the community again! :wink:

~B


#13

Well I sure look forward to nutting out the bare basics of tthe steps needed to achieve IoT in thee classroom setting via Pi. This is my main approach and mhy I have been a bit busy of late.

The cayenne approach I worked as hard as I could on knowing almost nothing about python but even though I ‘just missed the bus’ on this project these four videos will paint a pretty good context of what I am driving at and striving for.

http://technology.tki.org.nz/Technology-in-the-NZC/Strengthening-digital-technologies/Learning-with-the-internet-of-things

I see MyDevices Cayenne as a superb portal to make the connection for kids and teachers and a host of art, community and enviro projects. I just have to nut out the last parts of some demo MQTT Serial python and then should be ready to apply it in schools for some copy and paste projects.

Look forward to sharing some On Line results in next 6 months…

~ Andrew


#14

Cool videos :slight_smile:

Looking forward to the results too.

Cheers,

~Benny


#15

Hi

A few things…


#16

@picaxe your message got cut off I think, can you resend?


#17

Resend @picaxe ! We can’t take the suspense :blush:

~B