Telraam

Telraam setup in the UK

From reading an article published on the  BBC News website about Telraamhttps://www.bbc.co.uk/news/world-europe-51123760#, I found out about this innovative project, using off the shelf hardware with some clever programming to something that I'd been looking at (traffic monitoring via a Raspberry Pi) but had put off due to the likely complexity.

This tied in with some work I'm doing with the local Parish Council & a neighbour group looking at speed limits on my road & as I had most of the bits required already I thought I'd give it a go.

'My' Telraam overlooks a rural stretch of road in a 40mph (~64Kph) speed limit. Popular with cyclists (with a persistent hill for them to endure / enjoy), with a reasonable amount of farm traffic & heavy goods vehicles (including narrowboat deliveries to a local boat yard, and steam engines related to an enthusiast further along the road).

Notes / help

Some points are perhaps not as clear as they could be on the Telraam sites or often just not easy to find, below are quick notes on my experience setting up in the UK:

  1. You can build this using your own hardware, though I'd strongly recommend you use the same model of Raspberry Pi, and the same camera (Pi Cam v.2.1) other models of Raspberry Pi may not boot - I had most of what I needed from previous projects, & at the time of looking (late Jan 2020 the recommended supplier looked to be low on stock & expensive to ship to the UK)
  2. It turns out the correct model of Pi for Telraam is a Pi 3 model A+ (I'm using a Pi 3 model B+ which is unofficially supported - it uses the same board but has a usb hub, 4 x USB ports rather than 1 and includes a network port). I believe I'm getting additional heat generated by the USB hub / physical NIC (despite these not being used), Telraam support are ok with the B+.
  3. You can sign up as an individual, possibly as a group to 'use' the solution (strictly you are not using, but contributing)
  4. It's really easy to do :-)
  5. The main issue I've hit is robustly attaching the camera to the inside of a window, as this needs to be accurately angled down (harder to achieve in practice than it sounds...). The solution that the Telraam team have gone with looks really neat, their recommended supplier has fairly steep shipping costs to the UK, the usual UK suspects don't seem to stock anything similar but I've found part no. TEK-RPI CSW (black - 'clear' & white options available too) at https://www.reichelt.de for reasonable postage costs. It's a small point, but I've probably spent more time trying to get the camera secured to the window than the rest of the configuration...
  6. Persevere with the web site - the information is all there, & follow the instructions carefully
  7. Marking on the map - nothing worked for me on multiple browsers / computers (lots of clicking & moving mouse around) - until I powered the built Pi / Telraam on... (RTFM)
  8. The point when you initially power the Telraam on & connect to its local hotspot is the only time you get to see the image area (which looks to be larger, & lower resolution than the same camera showing an HD image @ 1080 x 1920 - be ready to adjust the camera at this point. If you enter Wi-Fi details then after the 10 minute countdown is complete it will reboot onto Wi-Fi and will not display the camera feed; to get the camera feed back you will have to power cycle the device (pull the cable if you've not sorted SSH access)
  9. The Telraam retains Wi-Fi details through a Power Cycle, though goes into the 10 minute Wi-Fi hotspot mode after each boot
  10. I suspect that connecting the Pi via an ethernet cable will work but may require fiddling to enable ethernet.
  11. best to sign up to the Telraam Facebook group & follow @TelraamTelraam on Twitter

 

Other tips for setup:

  1. Consider the length of the camera cable - I've gone for 2m, to keep the Pi out of the window (where it can get hot in summer when there is direct sunlight)
  2. The red & green power / activity lights on the Pi are quite bright - if this is in a bedroom then some marker pen or tape over the red & green lights is probably required, even with the Pi in a case (& a case is recommended)
  3. Sellotape & double sided sticky tape are pretty much essential, best to budget for these & have to hand (the kit looks like it includes these) if you are not buying a kit
  4. Don't forget to print, cut out and attach the mask.
  5. Don't forget to upload a photo showing the camera location / view - does not have to be the exact view, but if you have a look at some of the other Telraam devices you get a feel for what works.

 

After a few days, my initial thoughts:

  • No 'heavy vehicles' detected for the first ~week - the documentation suggests that the algorithm should 'detect' these after approx one week & mentions an update / reset each Sunday - classification of heavy vehicles commenced on the following Monday (I first powered the device on Saturday afternoon, so it took 8 1/2 days. the total count (pedestrian + cycle + car + heavy goods) looks the same before and after the 'calibration period', just the breakdown looks to have improved)
  • I've used a camera on time lapse to compare the device's accuracy (not that I can influence this), - after around 2 weeks of running totals across the hour I monitored are within 10% of actuals - update 10/03/2020 - there's not really much point in checking the accuracy - this has been done already, there's more in depth detail via this link: https://telraam.zendesk.com/hc/en-us/articles/360027325572-Want-more-data-Telraam-API & associated links.
  • I had a few niggles, the reports are showing the time in CET or GMT / UTC +1, whilst I'm in the UK - e.g. GMT / UTC (update - this was fixed including for retrospective results on 05/03/2020)
  • there was no option to set my location as "UK" during sign up, so I went with the closest option at the time (which I think was the Dutch for 'unknown' or 'other'; a few days later a long list of countries popped up as options.
  • My laptop browser seems to be telling the Telraam map that I'm in Canada (I suspect due to user error), other browsers place me in the UK (London). Minor niggle.
  • Internet dropping seems to recover ok, Wi-Fi dropping likewise - device goes into AP mode for at least 10 mins, Wi-Fi SSID & passcode are cached.

 

Highlights /anomalies:

  • 24th Feb 2020 - local motorway (M56) had multiple lanes closed during morning rush hour, small increase in traffic on local roads
  • 11th March 2020 - local motorway (M6 north bound at J21) closed from 09:45 hrs, small increase in traffic past this Telraam (site of closure limited traffic coming past - previous closures slightly further south have massively increased traffic past Telraam location)
  • 12th & 13th March 2020 - issues with servers / my internet connection leading to poor recording of traffic / loss of data following reboot
  • 13th March, 16th March 2020 - Covid-19 advice to avoid crowds / contact with others starting to take effect in UK. Limited impact seen on this Telraam device (assumed that whilst traffic levels generally are dropping, the decrease in commuter traffic is balanced by an increase in local traffic. just guesswork though :-) )
  • From around 22nd March 2020 there is a sharp drop in traffic due to Covid-19 lockdown, with vehicle traffic roughly halving, pedestrian traffic & bicycles increasing (as above coinciding with improved weather)
  • 02/06/2020 first day of rain in weeks - noticeable drop in bicycles.
  • 22/07/2020 the local motorway was closed late afternoon, causing traffic to divert past the Telraam device. There's a really clear spike in vehicle traffic on the affected day here shown on the "overview in detail" graph
  • 26/07/2020 to 31/07/2020 a power cut on 26/07 wiped out part of my home network whilst I was on holiday, the Telraam device was a casualty of this (& picked up without any intervention once DHCP & internet access were restored)

 

Poor quality counts during sunshine:

during 22nd March to 28th March I noticed incomplete data capture during the day, gaps, periods of low quality results. Initially thought this was a PSU issue / heat dissipation (the Pi CPU gets HOT)

Anyway - ticket raised with the Telraam team. UPDATE 27/04/2020 these issues (periods of low quality / missing counts) had a strong correlation with sunny days. I saw a strong correlation with Pi power consumption (which can be measured) tied in with reduced power usage during sunny weather & low quality counts reported. (see image below)

Re-imaging the Telraam using the image that allows SSH connectivity to the Pi (& sorting out the nightly removal of SSH access), I was able to monitor CPU usage & processes, and look through the scripts that run on the Telraam device (these are also published).

so... CPU during my observations (on RPi3B+) hovers around 170% (sic), with reported temperature mostly around 50C reaching 60C in an armor case, no fans & ambient 20-25C - this is whilst the main Python script is running (not too dark, not too bright). The Python script accounts for >95% CPU time. I did not notice any obvious change in CPU use when vehicles go past / the road is quiet, though I was not really focussing on this. I used "top" to monitor CPU with the default sample period (around 10s)

It looks like the main monitoring script (that is CPU intensive when running) is quiesced when there is too little light (e.g. at night) but also when there is too much light (not sure why). In short, placing a camera lens filter in front of the Pi Cam reduces the amount of light, & acts as a simple hack to solve this issue. I've used a polarising filter, equivalent to f/2 or allowing approx 1/4 of the light through. The Telraam starts counting 10-20 mins later in the morning, and stops 10-20 mins earlier in the evening on sunny days (I'm happy with this). Ticket raised with the Telraam team who are investigating. After 7 days now there's a sharp improvement in count quality in sunny weather (see overview examples below, showing before & after filter installation). The Telraam team have confirmed they could see issues with counting prior to the time & date the filter was put into place.

User Carl has pointed out that passive 3D glasses are polarising filters & should achieve the same effect.

The Telraam team are working on a fix. The polarising filter works for me as a workaround, though on wet cloudy days in June I'm 'losing' up to 40 minutes of counting at the start / end of the day - given dawn is around 04:40 & sunset 21:30 at present this is not significant, but will look at alternate fixes if the Telraam team have not pushed out a software fix when the days get shorter.

 

Telraam graph showing poor quality counting
Telraam overview showing low quality capture, no filter installed (as per Telraam guide!). All days other than 2020-04-18 were clear skies & sunny (2020-04-18 was overcast with light rain)

 

Telraam capture showing before & after filter placed in front of Pi Cam
Telraam Overview - showing effect of filter installed in front of Pi Cam on 2020-04-20 at around 12:15hrs, all days other than 2020-04-18 were clear & sunny

04/06/2020 - Gaps in counting

I raised a ticket with Telraam about a small number of gaps in counting, affecting random hours of the week (examples on the third & last days shown in the image below):gaps in counting

I've had a response that the Telraam dev team found an issue with the server side algorithm, & this should be getting sorted. It may be able to resolve this retrospectively (e.g. the count data is present on the servers, but is / was not being shown via the web page).

 

Update 9th July 2020 - a new Telraam image is available, with improvements for checking the view the camera has of the street. The Telraam Dev team have updated the Dev image as well (allows SSH access to the Pi) - link above is still valid.

 

Links:

Telraam map / click on road sections to see data captured https://telraam.net/en/

Documentation: https://telraam.zendesk.com/hc/en-be