QT websockets

Everything about software tools, new software development and toolchains. For developers, mostly.

Moderators: marcelr, TheHogNL, TerrorSource, Toonz

QT websockets

Postby TheHogNL » Sat Feb 16, 2019 9:17 am

From firmware 5.0.4 the original Toon resources also include libraries for QT5 websockets!

To use the libraries install them when having the VPN running with "opkg install libqt5websockets5" (I will probably add an option to the update-script to install this for you soon).

After this you can use the library in your qml code with "import QtWebSockets 1.0"
From there just use the docs at https://doc.qt.io/qt-5/qtwebsockets-qmlmodule.html and the examples at https://doc.qt.io/qt-5/qtwebsockets-examples.html

Using websockets in your qml code would allow your Toon to be externally controlled. Much more possibilities then the current ones using the /happ_thermstat (and other) urls which only supports a few commands.

For example, the use case where a forum members wants to put a doorbell-camera picture on the Toon when someone is ringing the phone could now be implemented easily. Much more ideas are welcome!
Member of the Toon Software Collective
User avatar
TheHogNL
Forum Moderator
Forum Moderator
 
Posts: 1025
Joined: August 2017

Re: QT websockets

Postby Toonz » Sat Feb 16, 2019 10:59 am

I can now finally have a realtime status on Toon of the status of the klikaan/klikuit lights in the bedrooms (controlled via domoticz on a raspberry Pi)
No need for sending http requests to domoticz anymore every 5 seconds to query the status of the lights.
member of the Toon Software Collective
User avatar
Toonz
Forum Moderator
Forum Moderator
 
Posts: 1107
Joined: December 2016

Re: QT websockets

Postby Toonz » Sat Feb 16, 2019 11:03 am

It is also a perfect solution for someone to write a comprehensive mobile app to control the Toon remotely (using a companion app on Toon itself).
Basically everything is possible now, far beyond the options of the official mobile app from Quby :-)
Develop our own API?
member of the Toon Software Collective
User avatar
Toonz
Forum Moderator
Forum Moderator
 
Posts: 1107
Joined: December 2016

Re: QT websockets

Postby hvxl » Sat Feb 16, 2019 12:01 pm

Works like a charm. And it avoids my web server logs from filling up with all those poll requests!
Schelte
hvxl
Senior Member
Senior Member
 
Posts: 1182
Joined: June 2010

Re: QT websockets

Postby Toonz » Tue Feb 19, 2019 9:47 am

great stuff. By any change, did they also complie an UdpSocket class?
handy for sending discovery packets
member of the Toon Software Collective
User avatar
Toonz
Forum Moderator
Forum Moderator
 
Posts: 1107
Joined: December 2016

Re: QT websockets

Postby WickedMaster » Tue Apr 09, 2019 11:53 am

Toonz wrote:It is also a perfect solution for someone to write a comprehensive mobile app to control the Toon remotely (using a companion app on Toon itself).
Basically everything is possible now, far beyond the options of the official mobile app from Quby :-)
Develop our own API?


Me and RoadXY are trying to make use of QT websockets for the app we're currently working on. Any help is welcome!
User avatar
WickedMaster
Member
Member
 
Posts: 68
Joined: November 2018

Re: QT websockets

Postby RoadXY » Tue Apr 09, 2019 12:06 pm

Yes, any help is appreciated
RoadXY
Member
Member
 
Posts: 62
Joined: October 2015

Re: QT websockets

Postby Toonz » Tue Apr 09, 2019 12:15 pm

a lot you can find in the QT documentation : https://doc.qt.io/qt-5/qml-qtwebsockets-websocket.html including sample code.
The WebSockets allow you to receive/send from/to a Toon QML app directly without making user of the lighttpd webserver.
Do you have already ideas about functionality you want to build?
Exactly what type of help is requested?
member of the Toon Software Collective
User avatar
Toonz
Forum Moderator
Forum Moderator
 
Posts: 1107
Joined: December 2016

Re: QT websockets

Postby WickedMaster » Tue Apr 09, 2019 12:23 pm

At this point we're looking for a possibility to change/add programs from the app. Eventually we want to do everything with websockets in the app. So, also changing the temperature, fetching information etc.. This is currently done by using HTTP requests. But, changing/adding programs, doesn't seem to be able by using HTTP post/requests.

It would be helpful if someone can assist us with setting up a new QML app/module for the Toon, so that we have a base to lean on. We've got no experience with developing apps for the Toon itself.
User avatar
WickedMaster
Member
Member
 
Posts: 68
Joined: November 2018

Re: QT websockets

Postby RoadXY » Tue Apr 09, 2019 12:37 pm

By programs we mean the heating schedule
RoadXY
Member
Member
 
Posts: 62
Joined: October 2015

Re: QT websockets

Postby Toonz » Tue Apr 09, 2019 12:48 pm

That is not so straight forward. We can also look into modifying the quby schedule programming app for this (use websockets there)
member of the Toon Software Collective
User avatar
Toonz
Forum Moderator
Forum Moderator
 
Posts: 1107
Joined: December 2016


Return to Toon software development

Who is online

Users browsing this forum: No registered users and 1 guest