Toon app: Afvalwijzer

Forum about forum-provided applications on Toon

Moderators: marcelr, TheHogNL, Toonz

Marijn
Starting Member
Starting Member
Posts: 40
Joined: Wed Jul 03, 2013 8:13 pm

Re: Toon app: waste collection (Afvalwijzer)

Post by Marijn »

Toonz keep up the good work! just before I would install de 1.1 version I took a look @ this topic. Just in time for version 1.2. Now running on Toon. :D
cygnusx
Starting Member
Starting Member
Posts: 48
Joined: Tue Apr 14, 2015 10:12 am

Re: Toon app: waste collection (Afvalwijzer)

Post by cygnusx »

i made a mockup of how i think the afvalwijzer app should look like:
toon_afval.jpg
toon_afval.jpg (115.57 KiB) Viewed 29603 times
The color of the icon is dependant of the kind of garbage. It only gets this state the day before around 17 o clock. When there is no upcoming garbage, the icon would be gray so it's clear that there is no attention needed. With plastic it is orange etc.
mockup_toon.jpg
mockup_toon.jpg (73.39 KiB) Viewed 29603 times
This is how it looks in dim state. When there is no upcoming garbage, then no icon/text. Otherwise a gray icon with the right container.

Multiple containers together? Then a text like "Grijs & Plastic".

What do you guys think?
Last edited by cygnusx on Fri May 26, 2017 3:05 pm, edited 1 time in total.
marcelr
Global Moderator
Global Moderator
Posts: 1153
Joined: Thu May 10, 2012 10:58 pm
Location: Ehv

Re: Toon app: waste collection (Afvalwijzer)

Post by marcelr »

It's nice, but do remember that the forum language is English!!
Toonz
Forum Moderator
Forum Moderator
Posts: 1873
Joined: Mon Dec 19, 2016 1:58 pm

Re: Toon app: waste collection (Afvalwijzer)

Post by Toonz »

Do you also have icons for the other waste types?
Happy to change the tile in non-dim state on waste collection days....
member of the Toon Software Collective
marcelr
Global Moderator
Global Moderator
Posts: 1153
Joined: Thu May 10, 2012 10:58 pm
Location: Ehv

Re: Toon app: waste collection (Afvalwijzer)

Post by marcelr »

Toonz wrote:If you want me to add more waste providers just let me know (it helps if you send me the URL to retrieve the dates).
Could you have a look at this one (Eindhoven area):

https://afvalkalender.cure-afvalbeheer.nl

For a post code and house number you can use: 5611 EM 10 (Eindhoven's Town hall).
Cure will provide ics support, once the post code and number are known:

https://afvalkalender.cure-afvalbeheer. ... 0000082091

(the file is called inzameling.ics, I just put it down here in case the link stops working):

Code: Select all

BEGIN:VCALENDAR
VERSION:2.0
PRODID:afvalkalender.cure-afvalbeheer.nl_ophalen
X-WR-CALNAME:Afvalkalender
X-PUBLISHED-TTL:P1W
BEGIN:VEVENT
UID:59275156614da
DTSTART:20170608T070000
SEQUENCE:0
TRANSP:OPAQUE
DTEND:20170608T080000
SUMMARY:Papier en karton
CLASS:PUBLIC
DESCRIPTION:Papier en karton
DTSTAMP:20170525T234910Z
BEGIN:VALARM
TRIGGER:-PT12H
ACTION:DISPLAY
DESCRIPTION:Papier en karton wordt opgehaald
END:VALARM
END:VEVENT
BEGIN:VEVENT
UID:5927515661596
DTSTART:20170622T070000
SEQUENCE:0
TRANSP:OPAQUE
DTEND:20170622T080000
SUMMARY:Papier en karton
CLASS:PUBLIC
DESCRIPTION:Papier en karton
DTSTAMP:20170525T234910Z
BEGIN:VALARM
TRIGGER:-PT12H
ACTION:DISPLAY
DESCRIPTION:Papier en karton wordt opgehaald
END:VALARM
END:VEVENT
BEGIN:VEVENT
UID:5927515661601
DTSTART:20170706T070000
SEQUENCE:0
TRANSP:OPAQUE
DTEND:20170706T080000
SUMMARY:Papier en karton
CLASS:PUBLIC
DESCRIPTION:Papier en karton
DTSTAMP:20170525T234910Z
BEGIN:VALARM
TRIGGER:-PT12H
ACTION:DISPLAY
DESCRIPTION:Papier en karton wordt opgehaald
END:VALARM
END:VEVENT
BEGIN:VEVENT
UID:5927515661665
DTSTART:20170601T070000
SEQUENCE:0
TRANSP:OPAQUE
DTEND:20170601T080000
SUMMARY:Papier en karton
CLASS:PUBLIC
DESCRIPTION:Papier en karton
DTSTAMP:20170525T234910Z
BEGIN:VALARM
TRIGGER:-PT12H
ACTION:DISPLAY
DESCRIPTION:Papier en karton wordt opgehaald
END:VALARM
END:VEVENT
BEGIN:VEVENT
UID:59275156616c8
DTSTART:20170615T070000
SEQUENCE:0
TRANSP:OPAQUE
DTEND:20170615T080000
SUMMARY:Papier en karton
CLASS:PUBLIC
DESCRIPTION:Papier en karton
DTSTAMP:20170525T234910Z
BEGIN:VALARM
TRIGGER:-PT12H
ACTION:DISPLAY
DESCRIPTION:Papier en karton wordt opgehaald
END:VALARM
END:VEVENT
BEGIN:VEVENT
UID:5927515661729
DTSTART:20170629T070000
SEQUENCE:0
TRANSP:OPAQUE
DTEND:20170629T080000
SUMMARY:Papier en karton
CLASS:PUBLIC
DESCRIPTION:Papier en karton
DTSTAMP:20170525T234910Z
BEGIN:VALARM
TRIGGER:-PT12H
ACTION:DISPLAY
DESCRIPTION:Papier en karton wordt opgehaald
END:VALARM
END:VEVENT
BEGIN:VEVENT
UID:592751566178c
DTSTART:20170713T070000
SEQUENCE:0
TRANSP:OPAQUE
DTEND:20170713T080000
SUMMARY:Papier en karton
CLASS:PUBLIC
DESCRIPTION:Papier en karton
DTSTAMP:20170525T234910Z
BEGIN:VALARM
TRIGGER:-PT12H
ACTION:DISPLAY
DESCRIPTION:Papier en karton wordt opgehaald
END:VALARM
END:VEVENT
BEGIN:VEVENT
UID:59275156617ec
DTSTART:20170531T070000
SEQUENCE:0
TRANSP:OPAQUE
DTEND:20170531T080000
SUMMARY:Restafval
CLASS:PUBLIC
DESCRIPTION:Restafval
DTSTAMP:20170525T234910Z
BEGIN:VALARM
TRIGGER:-PT12H
ACTION:DISPLAY
DESCRIPTION:Restafval wordt opgehaald
END:VALARM
END:VEVENT
BEGIN:VEVENT
UID:5927515661850
DTSTART:20170607T070000
SEQUENCE:0
TRANSP:OPAQUE
DTEND:20170607T080000
SUMMARY:Restafval
CLASS:PUBLIC
DESCRIPTION:Restafval
DTSTAMP:20170525T234910Z
BEGIN:VALARM
TRIGGER:-PT12H
ACTION:DISPLAY
DESCRIPTION:Restafval wordt opgehaald
END:VALARM
END:VEVENT
BEGIN:VEVENT
UID:59275156618b4
DTSTART:20170614T070000
SEQUENCE:0
TRANSP:OPAQUE
DTEND:20170614T080000
SUMMARY:Restafval
CLASS:PUBLIC
DESCRIPTION:Restafval
DTSTAMP:20170525T234910Z
BEGIN:VALARM
TRIGGER:-PT12H
ACTION:DISPLAY
DESCRIPTION:Restafval wordt opgehaald
END:VALARM
END:VEVENT
BEGIN:VEVENT
UID:5927515661915
DTSTART:20170621T070000
SEQUENCE:0
TRANSP:OPAQUE
DTEND:20170621T080000
SUMMARY:Restafval
CLASS:PUBLIC
DESCRIPTION:Restafval
DTSTAMP:20170525T234910Z
BEGIN:VALARM
TRIGGER:-PT12H
ACTION:DISPLAY
DESCRIPTION:Restafval wordt opgehaald
END:VALARM
END:VEVENT
BEGIN:VEVENT
UID:5927515661977
DTSTART:20170628T070000
SEQUENCE:0
TRANSP:OPAQUE
DTEND:20170628T080000
SUMMARY:Restafval
CLASS:PUBLIC
DESCRIPTION:Restafval
DTSTAMP:20170525T234910Z
BEGIN:VALARM
TRIGGER:-PT12H
ACTION:DISPLAY
DESCRIPTION:Restafval wordt opgehaald
END:VALARM
END:VEVENT
BEGIN:VEVENT
UID:59275156619d8
DTSTART:20170705T070000
SEQUENCE:0
TRANSP:OPAQUE
DTEND:20170705T080000
SUMMARY:Restafval
CLASS:PUBLIC
DESCRIPTION:Restafval
DTSTAMP:20170525T234910Z
BEGIN:VALARM
TRIGGER:-PT12H
ACTION:DISPLAY
DESCRIPTION:Restafval wordt opgehaald
END:VALARM
END:VEVENT
BEGIN:VEVENT
UID:5927515661a39
DTSTART:20170712T070000
SEQUENCE:0
TRANSP:OPAQUE
DTEND:20170712T080000
SUMMARY:Restafval
CLASS:PUBLIC
DESCRIPTION:Restafval
DTSTAMP:20170525T234910Z
BEGIN:VALARM
TRIGGER:-PT12H
ACTION:DISPLAY
DESCRIPTION:Restafval wordt opgehaald
END:VALARM
END:VEVENT
END:VCALENDAR
Toonz
Forum Moderator
Forum Moderator
Posts: 1873
Joined: Mon Dec 19, 2016 1:58 pm

Re: Toon app: waste collection (Afvalwijzer)

Post by Toonz »

marcelr wrote: Could you have a look at this one (Eindhoven area):
Will have a look, not sure if it will work (Toon doesn't like https) but let you know

Regardz,

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

Re: Toon app: waste collection (Afvalwijzer)

Post by marcelr »

Will have a look, not sure if it will work (Toon doesn't like https) but let you know
Thanks, I will try and prepare a lighttpd with ssl support. Shouldn't be too hard.
Toonz
Forum Moderator
Forum Moderator
Posts: 1873
Joined: Mon Dec 19, 2016 1:58 pm

Re: Toon app: waste collection (Afvalwijzer)

Post by Toonz »

isn't lighttpd the webserver? Or is it also used as 'browser' when sending a XmlHttpRequest from QML to retrieve the http pages?
member of the Toon Software Collective
marcelr
Global Moderator
Global Moderator
Posts: 1153
Joined: Thu May 10, 2012 10:58 pm
Location: Ehv

Re: Toon app: waste collection (Afvalwijzer)

Post by marcelr »

lighttpd serves ports 80 and 7080/10080 on toon. It has a toon-specific module called mod_hcb_web.

With a little luck, the services are handled by lighttpd, and transferred to toon through this module. If the developers at Quby did halfway decent job, the web interfacing is abstracted from toon internals. So ssl should work ...
Anyway, toons lighttpd version (1.4.33) builds cleanly on the openembedded framework, now I need to find out its configuration for toon. Will be a bit more work to be done ...
marcelr
Global Moderator
Global Moderator
Posts: 1153
Joined: Thu May 10, 2012 10:58 pm
Location: Ehv

Re: Toon app: waste collection (Afvalwijzer)

Post by marcelr »

OK, it turns out that toon's lighttpd already has ssl support, you just need to switch it on in the config file.
Like this: create a certificate for lighttpd. I chose a quick and dirty hack to make one, just to see if it works.
Create the directory /HCBv2/etc/lighttpd/ssl, cd into it and issue:

Code: Select all

openssl req -new -x509 -keyout lighttpd.pem -out lighttpd.pem -days 365 -nodes
This creates a certificate, valid for one year, for your https server.
Add ssl support to lighttpd by adding the following to its config file ( the part from #added onwards, until # end):

Code: Select all

...
server.document-root        = "/HCBv2/www"

$SERVER["socket"] == ":10080" {
server.document-root = "/HCBv2/www"
}

#added  MR! 20170526

$SERVER["socket"] == ":443" {
server.document-root = "/HCBv2/www"
ssl.engine  = "enable" 
ssl.pemfile = "/HCBv2/etc/lighttpd/ssl/lighttpd.pem" 
}
# end add


## where to send error-messages to
server.errorlog             = "/tmp/lighttpd_error.log"
...
Reboot the machine.
Then test for a working https service from another machine:

Code: Select all

$ nmap toon1 -p 1-65535

Starting Nmap 6.40 ( http://nmap.org ) at 2017-05-26 23:24 CEST
Nmap scan report for toon1 (192.168.73.41)
Host is up (0.028s latency).
Not shown: 65528 filtered ports
PORT      STATE  SERVICE
22/tcp    open   ssh
80/tcp    open   http
443/tcp   open   https
5555/tcp  open   freeciv
5900/tcp  closed vnc
7080/tcp  closed empowerid
10080/tcp open   unknown

Nmap done: 1 IP address (1 host up) scanned in 157.58 seconds
Looks OK to me.
In recent updates Quby have submitted ca certificates to toon, will look into using these for private keys. Gives better security than the quick-and-dirty method presented here (and will stop browsers from moaning about an insecure website).

Not sure if this is any good for Eindhoven's afvalkalender, though :-)


Oh, BTW: you will need to open port 443 in the firewall:

add

Code: Select all

-A HCB-INPUT -p tcp -m tcp --dport 443 --tcp-flags SYN,RST,ACK SYN -j ACCEPT
to /etc/default/iptables.conf, and restart iptables:

Code: Select all

/etc/init.d/iptables restart
Toonz
Forum Moderator
Forum Moderator
Posts: 1873
Joined: Mon Dec 19, 2016 1:58 pm

Re: Toon app: waste collection (Afvalwijzer)

Post by Toonz »

Great. Will have a look. First finishing the tile rotation stuff on the homescreen then on to Eindhovens waste :D .
Progress might be slower coming days because of the heat .....
member of the Toon Software Collective
Toonz
Forum Moderator
Forum Moderator
Posts: 1873
Joined: Mon Dec 19, 2016 1:58 pm

Re: Toon app: waste collection (Afvalwijzer)

Post by Toonz »

@marcelr: I implemented the https functionality as you described. Working fine from the outside (Toon as webserver) but https calls from Toon still don't work (Toon as webbrowser). Unfortunately.......

Two alternative options: use a raspberry or other machine in the middle or once a year manually edit the waste file calendar :-( (sooooo 90's)

Regardsz,

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

Re: Toon app: waste collection (Afvalwijzer)

Post by marcelr »

OK, will need to check whether it's the qt-gui or the library. Another option is to use wget as man-in-the-middle, let wget download the calendar file (cron job) and parse it from within toon. This means a rebuild of wget (toon's wget doesn't have https support either, but that's easily fixed).
Toonz
Forum Moderator
Forum Moderator
Posts: 1873
Joined: Mon Dec 19, 2016 1:58 pm

Re: Toon app: waste collection (Afvalwijzer)

Post by Toonz »

A new wget seems easier ...... while you look into the qt-gui / library: could you see whether it is possible to include QtWebSockets as well?
member of the Toon Software Collective
marcelr
Global Moderator
Global Moderator
Posts: 1153
Joined: Thu May 10, 2012 10:58 pm
Location: Ehv

Re: Toon app: waste collection (Afvalwijzer)

Post by marcelr »

wget is the quick-and-dirty fix. Adding qtwebsockets is probably the way to go, but the build is a lot more complex than just building wget. I don't have that one ready in the next few weeks or so. So, I'll do wget first.
Post Reply

Return to “Toon Apps”