Software: modifications and extensions Toon

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

Moderators: marcelr, TheHogNL, Toonz

Post Reply
marcelr
Global Moderator
Global Moderator
Posts: 1153
Joined: Thu May 10, 2012 10:58 pm
Location: Ehv

Re: Software: modifications and extensions Toon

Post by marcelr »

Still no luck. Writing's fine, reading isn't.
Toonz
Forum Moderator
Forum Moderator
Posts: 1877
Joined: Mon Dec 19, 2016 1:58 pm

Re: Software: modifications and extensions Toon

Post by Toonz »

Hi Marcel,

reading back the default station is tougher then I thought, to get it right in all circumstances.
I therefore reverted back to start with a default station at boot.
This station can be put in BuienradarApp.qml lines 18/19.
Other selected stations will stay active till next reboot (this should be no issue for operational Toons)
I'm fine to consider this as a stable release for now (feel free to adjust the tile of course)

I will be a bit slower with updates as my holiday is coming to end and I need to setup (root) my dev Toon first.

Regards

EDIT (marcelr): Download file moved to Downloads thread.
member of the Toon Software Collective
BrainHunt
Starting Member
Starting Member
Posts: 23
Joined: Thu Jun 30, 2016 11:37 am

Re: Software: modifications and extensions Toon

Post by BrainHunt »

Hi All,
Thank you for the great work like the new buienradar tile. It encouraged me to also look into this again.
@Toonz/Marcelr: do you use some tools to test your scripts before uploading it to the Toon? I currently debug it by uploading it but that's quite time consuming...

I am currently working on two small projects: a rain expectation tile and a tile for the temperatures in the various rooms at home (through domoticz). I have already figured out how to get the data for the two tiles (and got it working) but I hope you can point me in the right direction regarding showing it at the tile:
1. Do you know how to show a list? I now use the scroll list that is also used in the Kodi plugin but I don't need the slider on the side and it's very ugly on a tile :) . Any suggestions?
2. More challenging: how to show a graph on a screen? I have looked in the graph folder but it seems that most of the graphs there are already preconfigured for the energy measurements. Also it refers to a 'Graphutil' library that I cannot find neither on the device nor on the internet. I can also show the data in a list but that's far less attractive...

Thanks for your help! As soon as I have something working, I will share it here.
marcelr
Global Moderator
Global Moderator
Posts: 1153
Joined: Thu May 10, 2012 10:58 pm
Location: Ehv

Re: Software: modifications and extensions Toon

Post by marcelr »

do you use some tools to test your scripts before uploading it to the Toon? I currently debug it by uploading it but that's quite time consuming...
It is, and it's not very reliable either.

So far, most of the work is done in the javascript code, and that's easily debugged with a local webserver and browser (I use apache and firefox). qml is mostly used for rendering, so not as code intensive as the javascript (at least for now).
And, to quote the second rule of the sudo lecture: Think before you type. Saves a lot of gui restarts.
Toonz
Forum Moderator
Forum Moderator
Posts: 1877
Joined: Mon Dec 19, 2016 1:58 pm

Re: Software: modifications and extensions Toon

Post by Toonz »

marcelr wrote:

Code: Select all

killall qt-gui; /HCBv2/sbin/qt-gui -platform linuxfb -plugin Tslib --daemon 2>&1
Execute this command in a terminal (on a _single_ line), and watch all output fly by. By the time you can start handling the gui, output rates calm down a little and you can see what's going on, including console.log() output :-).
Hi Marcel,

I noticed that often (about 4 out of 10 attempts) the output stops flowing to the console after the first stage of starting qt (I am using putty in Windows), so before my own apps are started.
I found out that when I stop the logging to the console with CTRL-Z during startup in those cases and repeat the killall command above with the cursor up, it always works fine second time.
Don't know why but maybe it helps others as well.
Last edited by Toonz on Wed Jan 11, 2017 12:31 am, edited 1 time in total.
member of the Toon Software Collective
Toonz
Forum Moderator
Forum Moderator
Posts: 1877
Joined: Mon Dec 19, 2016 1:58 pm

Re: Software: modifications and extensions Toon

Post by Toonz »

BrainHunt wrote:1. Do you know how to show a list? I now use the scroll list that is also used in the Kodi plugin but I don't need the slider on the side and it's very ugly on a tile :)
Hi BrainHunt,

You can use the 'flickable' option to make a large text box scrollable (see the last rectangle in BuienradarDetailScreen.qml as an example).
You can the swipe up and down to scroll. Not sure it that works nicely on a tile though but worth a try maybe.
member of the Toon Software Collective
BrainHunt
Starting Member
Starting Member
Posts: 23
Joined: Thu Jun 30, 2016 11:37 am

Re: Software: modifications and extensions Toon

Post by BrainHunt »

Thanks for you response, very helpful.

So far, I did the debugging by sending the 'debugging output' to my domoticz log so I could see there how the values change.

By the way (just FYI), when analyzing the various qml files, I found a description in the tile qml that states that you can also use active objects such as buttons on tiles.
helppp
Starting Member
Starting Member
Posts: 3
Joined: Thu Jan 12, 2017 1:54 pm

Re: Software: modifications and extensions Toon

Post by helppp »

I hope it is fine to ask this, if not please let me know. I have been looking for an Eneco Toon for some time now. What I want is to use it as thermostat but show on the display a webbrowser. Anybody knows if this is possible? It is running Linux I think?
marcelr
Global Moderator
Global Moderator
Posts: 1153
Joined: Thu May 10, 2012 10:58 pm
Location: Ehv

Re: Software: modifications and extensions Toon

Post by marcelr »

You can ask whatever you want, as long as it's more or less in line with common decency ;-).

Netsurf has been reported to run on a linux framebuffer device. Not sure what it's memory footprint is. There's not a lot more you can add to a toon with the current firmware.
Toonz
Forum Moderator
Forum Moderator
Posts: 1877
Joined: Mon Dec 19, 2016 1:58 pm

Re: Software: modifications and extensions Toon

Post by Toonz »

Hi all,

After a week of working (burp) I found some time to continue with the Buienradar app.
One thing I found missing: the actual buienradar images :)

changelog:
- added a big weather icon to the tile (in dim state) based on the famous 'ID' and 'zin' tags and the day of time (like Eneco does), looking very nice imho.
- added a tray icon to the homescreen which starts a separate screen with the big buienradar radar images (animated gifs) :D
- added a small version of the radar images to the existing Details screen as well
- changed the update frequency to 10 minutes (was 15)

I can't really choose between the big screen with radar images and the small one. Happy to hear your views. I can leave both as is of course.
The radar images are refreshed each time you access either one of the two screens

EDIT (marcelr): Attachment removed, please get the latest version from the downloads thread.
member of the Toon Software Collective
marcelr
Global Moderator
Global Moderator
Posts: 1153
Joined: Thu May 10, 2012 10:58 pm
Location: Ehv

Re: Software: modifications and extensions Toon

Post by marcelr »

Looks good. Again :-)

Made some minor changes

Temperatures are now presented according to current locale. Looks better, especially on the dimmed screen.
Date in the details screen changed to dd-mm-yyyy HH:mm format.

ToDo: sunset time is now set to a number. IIRC I have some js code lying around that calculates sunrise/sunset according to the date and GPS position. Need to dig that up.

I think file reading can be done through the webserver. Haven't tried on toon, but by sending an xmlhttprequest to localhost (http://127.0.0.1/<whatever-filename-you-need>) I can read files, at least in javascript. Should work in qml as well (and qml can export the data to the gui, haven''t managed to do that with js yet). So, by placing the selectedLocation file somewhere where the webserver can find it, we should be good.

Oh, and I left the original code more or less in place, so you can see what's been changed.

EDIT (marcelr): Attachment removed, please get the latest version from the downloads thread.

best,

marcelr
Toonz
Forum Moderator
Forum Moderator
Posts: 1877
Joined: Mon Dec 19, 2016 1:58 pm

Re: Software: modifications and extensions Toon

Post by Toonz »

marcelr wrote:I think file reading can be done through the webserver. Haven't tried on toon, but by sending an xmlhttprequest to localhost (http://127.0.0.1/<whatever-filename-you-need>) I can read files, at least in javascript. Should work in qml as well (and qml can export the data to the gui, haven''t managed to do that with js yet). So, by placing the selectedLocation file somewhere where the webserver can find it, we should be good.
Marcel,

filereading through the webserver works fine indeed when the system is running (as well after a killall qt-gui command). I found however that it is unreliable after a cold boot of Toon. I noticed that sometimes it takes some time for my Wifi connection to get established, I somehow think it might affect the local webserver as well. Or it has to do with the way/order QT is initialising all the apps. Today I had the idea to have the system start with Rotterdam as default. Then only after the first retrieval of the XML read the 'selected station' file and run the update function again. Not a clean solution but probably one which will work in all circumstances. I will give that a try as well.
Many thanks for your changes....very helpful (and saves me quite some time googling as being new to most of this).
Your routine to calculate sunrise/sunset would be nice (the official Eneco app has a harcoded time as well).
Just thinking about f.lux, we could maybe remove some blue light from the screen as well after sunset.....(way beyond my skills)

Kind regards
member of the Toon Software Collective
marcelr
Global Moderator
Global Moderator
Posts: 1153
Joined: Thu May 10, 2012 10:58 pm
Location: Ehv

Re: Software: modifications and extensions Toon

Post by marcelr »

filereading through the webserver works fine indeed when the system is running (as well after a killall qt-gui command). I found however that it is unreliable after a cold boot of Toon. I noticed that sometimes it takes some time for my Wifi connection to get established, I somehow think it might affect the local webserver as well. Or it has to do with the way/order QT is initialising all the apps. Today I had the idea to have the system start with Rotterdam as default. Then only after the first retrieval of the XML read the 'selected station' file and run the update function again. Not a clean solution but probably one which will work in all circumstances. I will give that a try as well.
I'm not sure about the webserver's capabilities. qt-gui takes forever to start, but is the first service to be started in inittab.
Lighttpd is the last service to be started. I will have a look at the webserver's settings, probably it does not interfere too much with quby's code, although some server settings are part of the configuration files in /HCBv2/config ... Maybe if we start lighttpd much earlier in inittab, it could work.
If all else fails we can wrap lighttpd in a script and kill qt-gui at the start of that script ...

Not sure what f.lux is, but if I understand correctly, you want to introduce dawn/twilight into the colour scheme of toon. Fancy ;-).
Toonz
Forum Moderator
Forum Moderator
Posts: 1877
Joined: Mon Dec 19, 2016 1:58 pm

Re: Software: modifications and extensions Toon

Post by Toonz »

Hi Marcel,

starting lightpd earlier might help indeed.
Regarding f.lux (https://justgetflux.com/), I installed it at all my computers and ipad, can't do without anymore.
I understood that this functionality will be even part of the next windows maintenance release.

I will post a next buienrader beta soon (tomorrow) with the reading of the selected station at start to test the different boot options.

Regards
member of the Toon Software Collective
Toonz
Forum Moderator
Forum Moderator
Posts: 1877
Joined: Mon Dec 19, 2016 1:58 pm

Re: Software: modifications and extensions Toon

Post by Toonz »

marcelr wrote:ToDo: sunset time is now set to a number. IIRC I have some js code lying around that calculates sunrise/sunset according to the date and GPS position. Need to dig that up.
Hi Marcel,

no need to search for that js code. Sunset/Sunrise times are included in the buienradar XML file as well, I will use those values.

Kind regards,

Toonz
member of the Toon Software Collective
Post Reply

Return to “Toon software development”