I’ve been spending the last year or so playing with the Intel Arduino products – Namely the Intel Galileo and the Intel Edison. One of my projects the last few months has been Making a LinuxFromScratch Linux Kernel with full build tools, Xwindows, and QEMU running WinXP SP3. Included in this build is a XWindows software FrameBuffer w/ VNC capability; that way I can run a networked gui and do some GUI type work.
The Edison is cool because it’s just powerful enough to run WinXP under QEMU without any software emulation. While I wouldn’t call the Edision a speed demon – it should be good enough to allow printer drivers to function. The onboard storage for the Edison isn’t really big enough to run WinXP from the eMMC flash; so I opted to run a SSD attached to the USB2.0 port of the Edison. Edison runs as the “master”. The end goal of providing “always on” scanner and printer driver capabilities for my old HP all-in-one color laser and the ULS-25E laser cutter.
I also wanted to run a rotational drive .. to act as a swap space for both Linux and for the Winblows PageTable. To do this; I built a Microdrive FLEX to 44pin 2.5″ IDE adapter board and attached it to the Edison via a usb->ATA adapter. I verified all of this works with a usb hub.
With the concept proven; I set about generating a Intel Edison USB Storage Sled. This PCB provides power to the Edision and then connects up a 4port USB hub. This hub then serves the USB->SATA->mPCIe->Intel SSD, a USB->PATA->flexIDE Microdrive, and an extra device port. I set about putting the Sled in a SparkFun Edison Block compatible form factor early in the design phase. Clearly this much stuff on one board prevents me from adhering to the tiny formfactor; so I grew it in the X direction to 4.5″ wide and about 2.1″ tall. This board provides all the power to run the SSD and PATA interfaces. The board is 4 layers; due to USB2.0 routing requirements / impedance matching.
Why the Sparkfun Edison Block formfactor? Well simply put; I wanted to be able to expand the “system” with more features I don’t forsee at the moment. Example: I do not currently need an SDIO card on my Sled – honestly; I’m lazy and don’t want to route the pins. But; if later I need it – I can just buy Sparkfun’s Block and add it to the system.
I’m requesting comments / suggestions / peer reviews for the design; as a result I’m posting it here. The first 3pages of schematics are Licensed to you as Derivative works of Intel and Sparkfun. The last 3 pages and the PCB Layout are currently ALL RIGHTS RESERVEDCopyright 2015 by John Zitterkopf. ATM; I’m thinking I’d release the final design under a TAPR/NCL license… but I haven’t committed to that yet. Prototype Schematics / PCB Layout
In addition to the features above; I’ve designed in some USB Muxes to aid switching the Edison into Device or Host mode (similar to the Intel Edison Arduino board). I’ve also included the Lipo Battery charging circuit to provide a limited UPS type capability to the design incase of small power outages due to lightning or what not. Lastly; I added an I2C eeprom which can be programmed by the Edison for the USB to SATA bridge chip.
Here are some pictures of the finished prototype:
Feel free to leave a comment here (which will be reviewed by a human prior to posting) or provide comments in the various threads / project logs below:
Default configure options wouldn’t allow the server to compile. Complained about package ‘gl’ and ‘dri’ missing… likely because of the Mesa lib hoops I had to jump thru. The following allows ./configure to pass… make is in progress:
iPhones are rather picky about supporting non-Quicktime video files… as a result my EdiMax IC-7000PTn ip security camera’s motion notification emails weren’t viewable on the device… instead; I’d have to try and remember the external url to the camera and view live. After spending a weekend in Atlantic City for my Mom’s 60th b’day… and getting these useless notifications; I decided to do something about it.
At first; I tried to hack the security camera’s firmware… To complicated with to much risk; as EdiMax doesn’t provide sourcecode for the device… and none seems to have spend a large amount of time on this specific model.
Since I have my IP camera set to dump security motion files onto my LG NAS via FTP, I figured I might as well use the ARM cpu to convert these files using ffmpeg 0.11 and the x264 library to convert the files to a iPhone friendly format. It was a trick to install the x264 library; so please see this post for notes on how I did it. I have root /ssh access to the NAS; unsure if the stock firmware has this so see this post for pointers to the firmware I used. The NAS should have the other prerequisites already installed, but in-case I’ll try to list them all here:
I’ve decided to release the conversion script to the Interwebs via the MIT License for anyone to use. I’d appreciate a talkback/”thank you comment” below if you’ve used it. You can download the script here:
The script is fairly well commented so you should be able to modify it as needed. For the most part; the implementation specific variables are near the top of the script. The Must Change are as follows:
Location of the source videos to convert; typically a “dropbox” ftp-ed in from your camera
Backup location of the videos after conversion.
original files are saved for later review
file extention for the source videos.
Used to detect new files from “old”.
file extention for the converted videos.
Almost always “mp4” as to be compatible with iPhone.
External URL for your IP camera.
Can Specify :port in url for non-80 applications.
Typically a dynamic dns service.
Internal URL for your IP camera.
Can Specify :port in url for non-80 applications.
Used when your inside your home’s network.
Other interesting variables – change may be required
FileSystem location for the ffmpeg binary.
Use which ffmpeg to find it.
holds ffmpeg commandline options for trans-coding to iPhone format.
Could theoreticly be used to trans-code to other smartphone formats.
FileSystem location for the qt-faststart binary.
Used to reverse Quicktime(iPhone) metadata so video is played immediately instead of downloading.
Use which qt-faststart to find it.
FileSystem location for the uuencode binary.
Used to base64 encode the video files for MIME attachment.
Use which uuencode to find it.
Set to 0 to keep emails near 1screen on iPhone.
if non-root or non LG NAS; you may need to hard code this to the destination email address to send the notification to
if non-root or non LG NAS; you may need to hard code this ON for smtp authorization
if non-root or non LG NAS; you may need to hard code this a username for smtp authorization
This var is near the end of script
if non-root or non LG NAS; you may need to hard code this a password for smtp authorization
This var is near the end of script
number of days the converted files will remain in sourcelocation
number of days the orginal files will remain in backlocation
The script is designed to be run as root via crontab. The Author runs it every minute during daylight hours- this may change when/if he gets additional cameras with night vision. The current version of the script is designed to ensure no other encodings are running – ie more than one instance of iPhone.sh via job control (pgrep). The original video files are backed up to a specific folder and the script makes sure that directory exists.
When sending email using sSMTP; the script will timeout after 90seconds and kill the sSMTP app. You may want to increase this time if you have long videos or a slow Internet connection.
That’s about it… of course, YMMV – but this works very well on my systems and iPhone4. I can get multiple video attachments in a single email; each viewable on my iPhone from the email message.
As an example; here’s a screenshot of the email received on an iPhone4:
V1.1 improvements include a “backup” retiring system thanks to MikeS (a reporter at Hackaday.com) and Hackaday commenter gerphy. Their input included the find commands with some extra sauce to include variables for sourceage and backage.
Feedback is welcome – but all comments are screened by myself to prevent comment “spam”.
Trying to compile the x264 library (x264-snapshot-20120805-2245-stable) for the ARM926 in my LG NAS. Running ./configure seems to give a binary which won’t link with ffmpeg. Config.log in ffmpeg gives the following errors:
/usr/lib/gcc/arm-linux-gnueabi/4.3.2/../../../libx264.so: undefined reference to `d26′
/usr/lib/gcc/arm-linux-gnueabi/4.3.2/../../../libx264.so: undefined reference to `d22′
/usr/lib/gcc/arm-linux-gnueabi/4.3.2/../../../libx264.so: undefined reference to `d2′
/usr/lib/gcc/arm-linux-gnueabi/4.3.2/../../../libx264.so: undefined reference to `d20′
/usr/lib/gcc/arm-linux-gnueabi/4.3.2/../../../libx264.so: undefined reference to `d24′
/usr/lib/gcc/arm-linux-gnueabi/4.3.2/../../../libx264.so: undefined reference to `d0′
/usr/lib/gcc/arm-linux-gnueabi/4.3.2/../../../libx264.so: undefined reference to `q1′
collect2: ld returned 1 exit status
ERROR: libx264 not found
Here’s some random notes I used to make it work:
The .configure for x264 seems to default to cortex9 w/ Neon FPU… not present in my LGNAS. Run configure with the following options:
Where did I get arm926ej-s ? cat /proc/cpuinfo
According to this post; the LGNAS CPU (Marvell “Kirkwood”) does not have VFP support (would be listed as vfp under “Features” in cpuinfo) therefore do not specify a -mfpu= in the CFLAGS.