Tellstick duo. Custom firmware ?

Moderator: Telldus

Snakehand
Posts: 15
Joined: Thu Jan 18, 2018 11:08 am

Tellstick duo. Custom firmware ?

Post by Snakehand » Thu Jan 18, 2018 11:08 am

Hvis jeg har forstått riktig, så har tellstick Duo en USB bootloader, slik at det er lett å bytte ut firmwaren. Jeg kunne tenke meg å skrive egen firmware slik at motatte radiosignaler kan demoduleres på PCen. For å gjøre dette tenker jeg å overføre en rå strøm av RF data over et synkront USB endpoint. Omtrent som på et USB lydkort. PCen ka da lete etter sync bursts, og demoodulere et større utvalg av systemer enn hva firmwaren på Duen kan gjøre på egenhånd.

Men for å gjøre dette trenger jeg dokumentasjon på bootloader og Hardware. Uten dette må jeg fortsette prosjektet på min egenutviklet HW. Er det mulig å få tak i slik dokumentasjon, eller er den hemmelig ? :D

F

micke.prag
Site Admin
Posts: 2242
Joined: Thu Jan 18, 2018 11:08 am
Location: Lund
Contact:

Re: Tellstick duo. Custom firmware ?

Post by micke.prag » Thu Jan 18, 2018 11:08 am

Visst har Duo en bootloader, så det går utmärkt att ladda in en custom firmware.
Vi har dock inte hunnit sammanställa och publicera en mjukvara för att ladda en egen firmware ännu. Jag kan skicka dig en som fungerar att köra från Linux och lite dokumentation hur saker är anslutna på chippet.

Vår ambition är även att vår firmware till Duo ska släppas öppen.
Micke Prag
Software
Telldus Technologies

Skaven
Posts: 9
Joined: Thu Jan 18, 2018 11:08 am

Sv: Tellstick duo. Custom firmware ?

Post by Skaven » Thu Jan 18, 2018 11:08 am

Kommer detta gjälla .net modellen? Så man kan göra custom build?? Jag skulle villa ha sshd så man kan köra reboot på .net modellen
// Sorry About My Spelling I´m Dyslectic //

cyberdo
Posts: 6
Joined: Thu Jan 18, 2018 11:08 am

Re: Tellstick duo. Custom firmware ?

Post by cyberdo » Thu Jan 18, 2018 11:08 am

micke.prag wrote:Visst har Duo en bootloader, så det går utmärkt att ladda in en custom firmware.
Vi har dock inte hunnit sammanställa och publicera en mjukvara för att ladda en egen firmware ännu. Jag kan skicka dig en som fungerar att köra från Linux och lite dokumentation hur saker är anslutna på chippet.

Vår ambition är även att vår firmware till Duo ska släppas öppen.
Det låter fantastiskt!

Jag skulle gärna också prova att leka lite. Har lite sensorer som inte stöds än jag gärna skulle få in om jag har tid över. Det var dock ett tag sen jag kodade för PIC.

Finns det möjlighet att få access till firmwares i utvecklingsstadie? Jag misstänker att ni inte slåpper nya versioner för varje lite tweak ni gör.

micke.prag
Site Admin
Posts: 2242
Joined: Thu Jan 18, 2018 11:08 am
Location: Lund
Contact:

Re: Tellstick duo. Custom firmware ?

Post by micke.prag » Thu Jan 18, 2018 11:08 am

Skaven wrote:Kommer detta gjälla .net modellen? Så man kan göra custom build??
Finns redan: http://developer.telldus.com/blog/2012/ ... n-firmware
Skaven wrote:Jag skulle villa ha sshd så man kan köra reboot på .net modellen
Att porta ssh till PIC är nog mer jobb än det är värt. Däremot går det redan att reboota enheten genom nätverket. Flashverktyget för att uppgradera firmwaren gör just det.
cyberdo wrote:Finns det möjlighet att få access till firmwares i utvecklingsstadie?
Det kommer: http://developer.telldus.com/ticket/195
Micke Prag
Software
Telldus Technologies

jkp
Posts: 42
Joined: Thu Jan 18, 2018 11:08 am

Re: Tellstick duo. Custom firmware ?

Post by jkp » Thu Jan 18, 2018 11:08 am

Any news on opening the duo firmware code? Got a couple of weather stations from Clas Ohlson, one of which gives a promising blink on the Duo, but temperature & humidity are bogus (0xff). Would like to find out if they can be gotten to work, some more details at http://www.telldus.com/forum/viewtopic. ... 640#p15640

Perhaps it might be easier with the tellstick net with possibility for custom firmware already available, but would be great to have it work with the simpler Duo and with a raspberry Pi.

Edit: Feel free to answer in Swedish also if that's easier, I can read that.

jkp
Posts: 42
Joined: Thu Jan 18, 2018 11:08 am

Re: Tellstick duo. Custom firmware ?

Post by jkp » Thu Jan 18, 2018 11:08 am

Hi,

Update to this: Good news is that it appears the source is now available, see https://github.com/telldus/tellstick-duo

Bad news is that according to the prerequisites specified, a proprietary C compiler / dev platform is required to compile the code. The price for that appears to be $1195 single-user license, which probably isn't something which many will be paying if the need is just to try to add support for some new devices.

In the free software world, seems that there are free assembler & linker tools available for pic18,
http://microcontrollers.2385.n7.nabble. ... 67492.html.

The C compiler SDCC http://sdcc.sourceforge.net/index.php appears to ave pic18 support as "work in progress", not clear how much progress has been achieved.

Anyone happen to be familiar with SDCC for pic18 & the GNU PIC tools for pic18, would it be feasible to use them for practical use for compilation for the Duo? Probably would require modification to the source, anyone who can estimate how extensive?

If SDCC & GNU PIC tools are useful for development, any possibility of having duo firmware published in some form (assembly or linkable object code) which could be mixed with custom code compiled with free tools?

jkp
Posts: 42
Joined: Thu Jan 18, 2018 11:08 am

Re: Tellstick duo. Custom firmware ?

Post by jkp » Thu Jan 18, 2018 11:08 am

Looked at the code, it doesn't seem too complicated. So, hopefully a port to a different compiler wouldn't be too complex, assuming the different compiler can create working code. Also, complexity doesn't seem too much to modify even in assembly.

svartöra
Posts: 31
Joined: Thu Jan 18, 2018 11:08 am

Re: Tellstick duo. Custom firmware ?

Post by svartöra » Thu Jan 18, 2018 11:08 am

The firmware compiles just fine with the free version of the recommended compiler. All you need to do is to register with Microchip.

But as I have just one Duo, I haven't dared to download the binary :)

jkp
Posts: 42
Joined: Thu Jan 18, 2018 11:08 am

Re: Tellstick duo. Custom firmware ?

Post by jkp » Thu Jan 18, 2018 11:08 am

Are you sure it works with the free (Lite) version? Or could it be that the downloaded compiler binary works in pro mode for 45 days evaluation period as a pro version?

Anyway, I've now got the compiler downloaded, perhaps I'll test.

jkp
Posts: 42
Joined: Thu Jan 18, 2018 11:08 am

Re: Tellstick duo. Custom firmware ?

Post by jkp » Thu Jan 18, 2018 11:08 am

I compiled with the lite mode (compiler offers the choice of demo mode or lite mode or license key mode at install time), and seems to work, with lots of message suggesting to use the PRO mode:

Code: Select all

Memory Summary:
    Program space        used  2AF3h ( 10995) of  8000h bytes   ( 33.6%)
    Data space           used   5BAh (  1466) of   600h bytes   ( 95.4%)
    Configuration bits   used     2h (     2) of     7h words   ( 28.6%)
    EEPROM space         used     0h (     0) of   100h bytes   (  0.0%)
    ID Location space    used     0h (     0) of     8h nibbles (  0.0%)

Running this compiler in PRO mode, with Omniscient Code Generation enabled,
often produces code which is 60% smaller and at least 400% faster than in
Lite mode. The HI-TECH C PRO compiler output for this code could be
11972 bytes smaller and run 4 times faster.
See http://www.microchip.com for more information.
Haven't tested yet, not even sure if this will fit in the Duo, considering all the notices about size and all :-)

jkp
Posts: 42
Joined: Thu Jan 18, 2018 11:08 am

Re: Tellstick duo. Custom firmware ?

Post by jkp » Thu Jan 18, 2018 11:08 am

Looking at the earlier discussion, if I understand correctly, it should be relatively safe (bricking-wise) to flash the custom firmware, even if it wouldn't work. Correct?

Micke.prag, I'm interested in having a Linux flasher for the Duo (don't have a Windows machine available that easily), so if you can, I'd be grateful if you send the one you mentioned to me at jkp@iki.fi

jkp
Posts: 42
Joined: Thu Jan 18, 2018 11:08 am

Re: Tellstick duo. Custom firmware ?

Post by jkp » Thu Jan 18, 2018 11:08 am

I flashed a slightly modified version compiled with the lite option of the compiler, and it works.

svartöra
Posts: 31
Joined: Thu Jan 18, 2018 11:08 am

Re: Tellstick duo. Custom firmware ?

Post by svartöra » Thu Jan 18, 2018 11:08 am

Good to hear. I haven't dared to download my hex file yet.. it's better to have a second Duo for development.

I noted that the resulting hex file is smaller than the official builds:

Code: Select all

-rw-rw-r-- 1 db db  30308 Dec 12 21:33 TellStickDuo.hex
Compare with:
http://download.telldus.com/TellStick/S ... /firmware/

I still wonder if the boot code will handle the case where the download succeeds but the downloaded code is bad (like, sticks in a loop, or so). At work, with different products but similar problems, we have decided to handle the case where the download fails but we will not handle the case where the code itself does bad things.

jkp
Posts: 42
Joined: Thu Jan 18, 2018 11:08 am

Re: Tellstick duo. Custom firmware ?

Post by jkp » Thu Jan 18, 2018 11:08 am

Maybe the size difference has to do with different versions - the net site has a .hex file for firmware v4, but the published source is for v5 (for non-custom flashing v5 firmware is bundled in the flasher).

The hex file I built is 31620 bytes.

Seems I perhaps was a bit over-confident about (un)bricking due to less than careful reading of a note - I thought that I had read that Tellsticks can probably be unbricked in case of flash failure, but appears that the note was only about the Tellstick Net:
Q: I lost the power while flashing my TellStick Net and now it is bricked, what can I do?
A: Don't worry. It will probably be possible to fix it without sending your device to us. Please see our guide.
http://developer.telldus.com/wiki/Firmware

Looking at this from another angle, there are comments in this thread that the Duo has a bootloader. On cursory look I didn't see anything related to flashing or entering the bootloader in the published firmware source. So, if the firmware code doesn't contain code related to flashing, can we deduce from this that the bootloader/flasher in the Duo is not touched at flashing, and entering the bootloader is independent of the flash contents? If so, I'd think unbricking after flashing with failing software would be possible.

(Edit: I'm thinking maybe the PIC / PIC interface does something along the way of offering two interfaces via the USB port, one for bootloader/flasher and one for a serial port to communicate to the app, and accessing bootloader/flash will direct control to the bootloader/flasher. Not familiar with the device / PIC, so I might be off base here)

Post Reply