Software: modifications and extensions Toon

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

Moderators: marcelr, TheHogNL, Toonz

makkie2002
Member
Member
Posts: 66
Joined: Fri Aug 18, 2017 3:28 pm

Re: Software: modifications and extensions Toon

Post by makkie2002 »

QuasaR wrote: This is the complete list of packages they supplied with the last update.

Code: Select all

base-qb2-ene_3.7.9-1067-0_qb2.ipk
ca-certificates_20160104-r0_all.ipk
firmware-ba_1.43_qb2.ipk
firmware-ma_1.94_qb2.ipk
happ-kpi_1.318-master_qb2.ipk
happ-pwrusage_1.561-ene-master_qb2.ipk
happ-scsync_1.213-ene-master_qb2.ipk
happ-smartplug_1.153-master_qb2.ipk
happ-thermstat_1.1117-ene-master_qb2.ipk
happ-weather_1.115-master_qb2.ipk
hcb-bxtproxy_1.133-master_qb2.ipk
hcb-config_1.283-master_qb2.ipk
hcb-netcon_1.288-master_qb2.ipk
hcb-rrd_2.140-master_qb2.ipk
hdrv-p1_1.609-ene-master_qb2.ipk
hdrv-zwave_1.905-master_qb2.ipk
libhcb-base_1.244-master_qb2.ipk
libhcb-boxtalk_1.108-master_qb2.ipk
libhcb-com_1.109-TN-master_qb2.ipk
libhcb-drv_1.304-master_qb2.ipk
libhcb-xml_1.95-master_qb2.ipk
qt-gui_1.6755-ene-release-ene-3.7_qb2.ipk
x11vnc_0.9.13-r2_qb2.ipk
How do you get this list?
And how do you download these packages?
I am particularly interested in the x11vnc package.
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 »

After getting a notification that there's an update available,
go to /mnt/data/update
and

Code: Select all

ls -l *.ipk
From readig your other possts, I think you got x11vnc working now ...
makkie2002
Member
Member
Posts: 66
Joined: Fri Aug 18, 2017 3:28 pm

Re: Software: modifications and extensions Toon

Post by makkie2002 »

marcelr wrote:After getting a notification that there's an update available,
go to /mnt/data/update
and

Code: Select all

ls -l *.ipk
This what is in mine:

Code: Select all

-rwxr--r--    1 root     root         13688 Aug 17 19:08 _opkg.qb2-ene-9.9.99.script.sh
-rw-r--r--    1 root     root          9432 Aug 19 15:16 _opkg.qb2-ene-9.9.99.script.sh.log
-rw-r--r--    1 root     root             9 Aug 19 15:16 _opkg.qb2-ene-9.9.99.script.sh.res
-rw-r--r--    1 root     root           287 Aug 17 19:08 _opkg.qb2-ene-9.9.99.script.sh.sig
-rw-r--r--    1 root     root         54486 Aug 18 19:14 buienradar_8.0.7-r0_qb2.ipk
-rw-r--r--    1 root     root         24164 Aug 19 15:14 fileinfo_1.0.5-r0_qb2.ipk
-rw-r--r--    1 root     root          9808 Aug 18 19:14 temperaturelogger_1.2.2-r0_qb2.ipk
But I have to say that I did the update via the GUI ... not via the CLI ... can it be that the installed packages have been removed after the update?
From readig your other possts, I think you got x11vnc working now ...
That was installed via your tutorial and manually uploading the ipg file posted by you ... I wanted to have the "official" x11vnc from quby 8) .
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 »

The quby update code removes all files from /mnt/data/update. That you still find something there is because we are still in the beta phase of toonstore. As soon as we feel comfortable that everything works as it should, toonstore will also do a full cleanup after installation. In the latest version, this is already partially implemented.
makkie2002 wrote: That was installed via your tutorial and manually uploading the ipg file posted by you ... I wanted to have the "official" x11vnc from quby 8) .
Mine is better, actually :mrgreen:
TheHogNL
Forum Moderator
Forum Moderator
Posts: 2125
Joined: Sun Aug 20, 2017 8:53 pm

Re: Software: modifications and extensions Toon

Post by TheHogNL »

Hi,
I would like to know if there is a basic template/tutorial how to start developing the qml apps. I can program in a couple of languages but never used Qt. What is the basic needs? Can I develop on my pc and test run it there? Or do I always need the Toon to test the app?

I would like to develop an app to show the hourly tariffs from EasyEnergy (https://www.easyenergy.com/nl/tarieven). I recently switched from Eneco to EasyEnergy as I would like to see if I can make my energy usage more smart. First I want just to see the tariffs on screen. Later I would like to see if I can arrange some automatic switching on and off some equipment depending on the tariffs (like boiling up my heatpump boiler, using the dishwasher etc).
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 »

The apps are mostly written in qml, which is a scripting language very similar to javascript. qt also accepts javascript.

To test, you will need a toon for testing, because all screen IO passes through toon's qt engine, which is specific for toon.
I think your proposed app is very interesting, so please go ahead with it, and just ask here if you need help/advice.

If you want to publish you app on the ToonStore, some fairly strict restrictions apply. Toonz and I have recently compiled a list of requirements for such apps,we are in the process of reviewing and finalizing it, and we will publish it here shortly.
TheHogNL
Forum Moderator
Forum Moderator
Posts: 2125
Joined: Sun Aug 20, 2017 8:53 pm

Re: Software: modifications and extensions Toon

Post by TheHogNL »

So there isn't a option to emulate the Toon on a development pc to test the app? If no, how is debugging done? Where are the errors displayed if a app isn't working, bad parsing, or just debug prints for me to see what is happening?
Member of the Toon Software Collective
Ierlandfan
Member
Member
Posts: 151
Joined: Thu Oct 03, 2013 7:53 pm

Re: Software: modifications and extensions Toon

Post by Ierlandfan »

If you mean to test the qml application(s) standalone without Toon then no.
In theory you could emulate the full Toon on your pc by using Qemu which is an emulator for all kinds of hardware including arm.
Toonz
Forum Moderator
Forum Moderator
Posts: 1873
Joined: Mon Dec 19, 2016 1:58 pm

Re: Software: modifications and extensions Toon

Post by Toonz »

TheHogNL wrote:So there isn't a option to emulate the Toon on a development pc to test the app? If no, how is debugging done? Where are the errors displayed if a app isn't working, bad parsing, or just debug prints for me to see what is happening?
Hi,

testing is done on Toon itself (tip: buy a second hand one on marktplaats for development).
Debugging is done in a couple of ways: you can restart the gui with console output redirected to your terminal window.
Toon is producing a lot of console ''garbage'' during startup but if you have made QML/Javascript syntax errors you will get a proper error essage in the console window in between.
Secondly, in your code you can write to the console via the console.log() function as well which can help you with debugging.
Thirdly, you can show additional field/values in your app on Toon during development as well or you can write values to external files.
By far an ideal development setup but it is workable, with probably a steep QML learning curve but google will be your friend :-).

Start with a full read of this topic and the topic "Toon as a domotica controller? "....

Hope this helps.

Kind regardz,

Toonz
member of the Toon Software Collective
TheHogNL
Forum Moderator
Forum Moderator
Posts: 2125
Joined: Sun Aug 20, 2017 8:53 pm

Re: Software: modifications and extensions Toon

Post by TheHogNL »

I have a very alpha version running. Only showing the current tariff which is updated every hour from the easyenergy website. And still need to works on the graphics. But it works.. it's something :D


Tips for other app development beginners:

- start with the default Clock app and play around with the variables to understand what it does
- the app directory name should be the name in the projects.xml file
- the app file itself should start with a capital, or else Toon wil not find the app
- debugging possible when running the qt-gui manually:

First edit the /usr/bin/startqt and add "exit" on the second line (after the #!/bin/sh line). This will cause the Toon not to restart qt-gui itself anymore.
Add some debugging into your app with "console.log("yourdebugtext")
Then start then qt-gui manually and only look for the debug lines you are interested in: " /HCBv2/sbin/qt-gui -platform linuxfb -plugin Tslib 2>&1 | grep -i yourdebugtext"

Don't forget to remove the 'exit' line in the startqt file and reboot your Toon when finished. Or else the qt-gui will not start automatically anymore.
Attachments
Toon EasyEnergy alpha version
Toon EasyEnergy alpha version
IMG_20170826_114509.jpg (294.46 KiB) Viewed 10209 times
Member of the Toon Software Collective
TerrorSource
Administrator
Administrator
Posts: 494
Joined: Thu May 04, 2017 9:28 pm

Re: Software: modifications and extensions Toon

Post by TerrorSource »

TheHogNL wrote:I have a very alpha version running. Only showing the current tariff which is updated every hour from the easyenergy website. And still need to works on the graphics. But it works.. it's something :D


Tips for other app development beginners:

- start with the default Clock app and play around with the variables to understand what it does
- the app directory name should be the name in the projects.xml file
- the app file itself should start with a capital, or else Toon wil not find the app
- debugging possible when running the qt-gui manually:

First edit the /usr/bin/startqt and add "exit" on the second line (after the #!/bin/sh line). This will cause the Toon not to restart qt-gui itself anymore.
Add some debugging into your app with "console.log("yourdebugtext")
Then start then qt-gui manually and only look for the debug lines you are interested in: " /HCBv2/sbin/qt-gui -platform linuxfb -plugin Tslib 2>&1 | grep -i yourdebugtext"

Don't forget to remove the 'exit' line in the startqt file and reboot your Toon when finished. Or else the qt-gui will not start automatically anymore.
I thought that editing the tariffs manually was a better idea but i now know the concept of EasyEnergy, pay per use per hour/day tariffs.
Makes it more complicated to get a nice graph for a year as you cannot set 1 tariff for the whole year.
TheHogNL
Forum Moderator
Forum Moderator
Posts: 2125
Joined: Sun Aug 20, 2017 8:53 pm

Re: Software: modifications and extensions Toon

Post by TheHogNL »

TerrorSource wrote: I thought that editing the tariffs manually was a better idea but i now know the concept of EasyEnergy, pay per use per hour/day tariffs.
Makes it more complicated to get a nice graph for a year as you cannot set 1 tariff for the whole year.
I currently don't care about the calculated costs in Toon. As long as the kWh (and m3) are stored correctly, somehow in the future I can calculate the costs myself. However, I do think that EasyEnergy does that better than me. :D

The app I'm building is for me to have a quick glance of cost of the kWh at present time and the near future so I can decide to turn on the dishwasher, laundry etc now or just wait a few hours more. Later on I hope I can arrange it that the Toon becomes my smart grid manager, turning on and off heavy equipment depending on the kWh price from EasyEnergy. Or, due to the lack of a good development for the Toon, just stick that part on a raspberry pi, leaving the Toon only to be the display for the current situation.

I'm also thinking about popup messages, like "low tariff in the next two hours" or "better keep low power, tariffs are high!"

BTW, I'm all electric. No gas for me anymore. But also with gas this could be usefull, for example heating up the house in the winter when gas price is low (during the night for example) and save a much gas during high tariffs as long as the house is not getting too cold. Only works for a decent isolated houses probably :-)
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 »

The next step could be automated switching of non time-critical appliances, based on prospected energy cost. Neat.
TheHogNL
Forum Moderator
Forum Moderator
Posts: 2125
Joined: Sun Aug 20, 2017 8:53 pm

Re: Software: modifications and extensions Toon

Post by TheHogNL »

TheHogNL wrote: - debugging possible when running the qt-gui manually:

First edit the /usr/bin/startqt and add "exit" on the second line (after the #!/bin/sh line). This will cause the Toon not to restart qt-gui itself anymore.
Add some debugging into your app with "console.log("yourdebugtext")
Then start then qt-gui manually and only look for the debug lines you are interested in: " /HCBv2/sbin/qt-gui -platform linuxfb -plugin Tslib 2>&1 | grep -i yourdebugtext"

Don't forget to remove the 'exit' line in the startqt file and reboot your Toon when finished. Or else the qt-gui will not start automatically anymore.
I noticed that this doesn't work all the time. Running qt-gui manually often results in that the tiles are not loaded.
Another way is to change the qt line in /etc/inittab to:
qtqt:245:respawn:/usr/bin/startqt >/var/log/qt 2>&1

And reboot. This will cause qt to log to the file /var/log/qt. You can then follow the logs with "tail -f /var/log/qt" and filter with grep: "tail -f /var/log/qt | grep -i yourdebugtext".

Don't forget to restore the original line in inittab after debugging, and reboot once again. Or else the (temp) file system on the Toon will fill up (64MB storage).
Member of the Toon Software Collective
TheHogNL
Forum Moderator
Forum Moderator
Posts: 2125
Joined: Sun Aug 20, 2017 8:53 pm

Re: Software: modifications and extensions Toon

Post by TheHogNL »

Showing the current tariff is now ready. See photo.
Two horizontal lines show when the tariffs are good, normal or bad, based on the quartile values of the whole day. The tariff text color will change according to this (green, orangje or red).

The code is far from complete. Still need a lot of santizing. But it works and I can share it. Better to create a new topic from now I guess?

What are the requirements for the app to be available in the Toon shop later on?
Attachments
IMG_20170827_100206.jpg
IMG_20170827_100206.jpg (41.66 KiB) Viewed 10136 times
Member of the Toon Software Collective
Post Reply

Return to “Toon software development”