Magic Lantern Forum

Developing Magic Lantern => General Development Discussion => Topic started by: g3gg0 on September 11, 2013, 09:00:55 PM

Title: [proposal] tr_wifi.mo - Transcend WiFi SD driver
Post by: g3gg0 on September 11, 2013, 09:00:55 PM
the transcend wifi cards recently got interesting, after an article about root'ing these devices was published.
(http://haxit.blogspot.com.es/2013/08/hacking-transcend-wifi-sd-cards.html)
(https://www.magiclantern.fm/forum/proxy.php?request=http%3A%2F%2Fupload.g3gg0.de%2Fpub_files%2F354e6bb0cc81c45af73e0a65199daf34%2Ftranscend-wifisd.jpg&hash=d77569224f15640ca0023e592f3a5aad)

internals:
(https://www.magiclantern.fm/forum/proxy.php?request=http%3A%2F%2Fupload.g3gg0.de%2Fpub_files%2F4f0499c765a4506fe75efc09774c8bf7%2Fimage33.png&hash=7e5e93ad3e8ca68fb5d0e5a189361222)

they contain an ARMv5 instruction set ARM926EJ with somewhere around 400 MHz and 32 MiB RAM.
plus an integrated 16 or 32 GiB SD card ;)
the used operating system is linux with busybox and a bunch of reaaaallllyyy hackish shell scripts.
you can place an 'autorun.sh' and it will get executed on startup... as root...

unfortunately the wifi speed is embarrasing slow - i got 1 MBit/s which is not making any fun with .cr2 files.
(no, dont even ask for raw video!)

Magic Lantern - tr_wifi.mo module functionality
 - "Enable TrWiFi" / "Disable TrWiFi" - places or removes autorun.sh with magic lantern specific code
 - "Mode: DirectShare" / "Mode: Internet" - depending on current mode switch to the other one for either accessing internet or tethering with mobile phone

plus providing these functions to other modules:
 - int32_t trwifi_get_file ( char *url, char *dst_file )
   the file at given URL is being downloaded and copied from the linux system to camera filesystem.
   as we can access the SD from linux, but this will compete with our DryOS filesystem driver, we have to use files like B:/ML/DATA/TR_UPLNK.DAT and B:/ML/DATA/TR_DNLNK.DAT.
   both camera and linux will access the files without changing anything in the file structure to transfer data between each other.
   possible structure: [payload_size][payload] where payload initially is a shell script that is executed by autorun.sh
   these shell scripts can use that comm channel for any arbitrary command specific to the script. the camera has to care for communicating with the right commands.

 - char *trwifi_exec ( char *command )
   execute any command on linux side and return its stdout as string

i am not sure if it makes sense or fun to implement tcp/udp connect/read/write functionality or even PTP functionality (by forwarding to DryOS PTP handler).
tunneling through these files may be a bit slow and complicated.


constructive feedback?

Title: Re: [proposal] tr_wifi.mo - Transcend WiFi SD driver
Post by: SDX on September 11, 2013, 09:07:51 PM
is the wifi speed good enough for streaming LV? Would be really cool to use these cards as transmitter for tablet/notebook based, external field monitors.
Title: Re: [proposal] tr_wifi.mo - Transcend WiFi SD driver
Post by: g3gg0 on September 11, 2013, 10:05:53 PM
i guess it is not fast enough to get a smooth frame rate :)
but mabye 1 frame /sec ?
Title: Re: [proposal] tr_wifi.mo - Transcend WiFi SD driver
Post by: marcb on September 12, 2013, 12:15:43 AM
This sounds interesting  :) Maybe one could use the processing power of the card's hardware to encode small proxy videos of the RAW footage. Ideally, the proxies would be small enough so that they could be streamed to a phone/tablet/laptop via the cards wifi.
Title: Re: [proposal] tr_wifi.mo - Transcend WiFi SD driver
Post by: g3gg0 on September 12, 2013, 12:20:29 AM
Maybe one could use the processing power of the card's hardware

which power?
its a 200 MHz device, even DIGIC is better ;)
Title: Re: [proposal] tr_wifi.mo - Transcend WiFi SD driver
Post by: marcb on September 12, 2013, 12:30:41 AM
Good point  ;D Is it possible to do it via DIGIC? Would be a very nice feature... Especially if the proxies could be streamed via wifi. But even without the wifi streaming it would be awesome to have small proxy clips on the cam in addition to the RAW clips.
Title: Re: [proposal] tr_wifi.mo - Transcend WiFi SD driver
Post by: Pelican on September 12, 2013, 01:40:41 AM
It can check and download the latest ML... :)
Title: Re: [proposal] tr_wifi.mo - Transcend WiFi SD driver
Post by: Greg on September 12, 2013, 02:01:36 AM
i guess it is not fast enough to get a smooth frame rate :)
but mabye 1 frame /sec ?

1Mb = 128KB
15FPS - 8,54KB (one frame)
We need 360x240 compressed jpg  ;D

It would make sense if the card have 5Mb or more speed.

Title: Re: [proposal] tr_wifi.mo - Transcend WiFi SD driver
Post by: eduperez on September 12, 2013, 09:26:45 AM
It can check and download the latest ML... :)

Can you expand on that please!? I am really tired of taking the card out of the camera to try each compilation...
Title: Re: [proposal] tr_wifi.mo - Transcend WiFi SD driver
Post by: SDX on September 12, 2013, 11:36:18 AM
I remember it to be miyake who did a great effort in making a system that updates autoexec.bin via PTP. He never finished it though. Maybe it could be useful.

EDIT: found it http://www.magiclantern.fm/forum/index.php?topic=2246
Title: Re: [proposal] tr_wifi.mo - Transcend WiFi SD driver
Post by: gerk.raisen on September 13, 2013, 12:11:42 PM
Better than the Transcend cards there are the PQI Air cards.
Same "hackability" (it seem that Flucard, Transcend and PQI share the same or very similar Linux-Busuybox inside.
Similar but the big difference is that PQI Aircard works like a microSD to SD converter.
You can put any microSDHC inside (up to 32Gb)
In theory it doesn't affect the microSD original speed.
So you can reach at least the class-10 speed, hopefully more (UHS-I card)


I was already thinking about some sort of PTP implementation to have a sort of "console", maybe in future when it will return to works also launch scripts.
I think your idea is good...go ahead :)
I can already test it on Flucard and PQI.
Title: Re: [proposal] tr_wifi.mo - Transcend WiFi SD driver
Post by: marcb on September 13, 2013, 05:45:49 PM
Remote control of the camera functions & ML settings via the wifi SD card paired with a smartphone or laptop would be pretty cool  :)

I was already thinking about some sort of PTP implementation to have a sort of "console", maybe in future when it will return to works also launch scripts.
I think your idea is good...go ahead :)
I can already test it on Flucard and PQI.