Embedded Puppy controls ethernet camera, records on USB

A home for all kinds of Puppy related projects
Post Reply
Message
Author
User avatar
QLeap
Posts: 6
Joined: Wed 07 Feb 2007, 06:13

Embedded Puppy controls ethernet camera, records on USB

#1 Post by QLeap »

We are using Puppy Linux in an embedded mode on an e-Box 2300. The e-Box acts as an FTP server (running pureFTP) capturing images coming from an Ethernet camera. Custom software performs three basic functions:

1) Controls the camera by issuing commands.
2) Recording data from a USB GPS device
3) Moves images from CF memory to a USB memory stick

The software is written, but we are facing several technical issues that need to be resolved to successful run the software.

The e-Box runs as an embedded computer with no monitor, keyboard or mouse. Power can be cut to the e-Box at any time. In order to save data (images & GPS) we need to write it to the USB memory stick. We have observed, since power can be cut at any time, that we cannot store data on the bootable CF since Puppy seems to only preserve its file system when properly shutdown.

Another effect of unexpectedly cutting power is that Puppy does not always boot X-Windows. Our custom software start-up scripts are in /root/.xinitrc and when X-Windows doesn't boot, our software doesn't start.

We've tried putting the start-up scripts in /etc/rc.d/rc.local, however, software run from that file does not mount the USB memory stick.

We are looking for a Puppy Linux expert that can help us configure the OS so our software reliably runs upon after power-offs and boot-ups. We have recently won a contract to deliver an alpha system based on the e-Box and can pay for your expertise and consulting services.

Please contact me at jobs@EstrellaVerdeTechnology.com if you'd like to help.

User avatar
richard.a
Posts: 513
Joined: Tue 15 Aug 2006, 08:00
Location: Adelaide, South Australia

#2 Post by richard.a »

I'm wondering if the problem is related to filesystem damage and/or corruption when the power goes off - what you might call an improper shutdown?

It will probably run e2fsk (the e2 filesystem check-and-repair utility) but I have a gut feeling that it will stop at the prompt automatically at that point, not running X.

I have seen this identical situation many times on copying a pup_save.2fs or pup_save.3fs file to create a backup to do experimental work on a known configuration. The first time you boot to it, it tells you that it crashed last time you ran it, and asks you if you want to run Xorgwizard again.

I'm not the right person to ask to help you troubleshoot it, but that info may be enough to get a guru to scratch their heads and work a solution out for you :)

Best of luck, mate,

Richard in Oz
[i]Have you noticed editing is always needed for the inevitable typos that weren't there when you hit the "post" button?[/i]

[img]http://micro-hard.dreamhosters.com/416434.png[/img]

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

Re: Embedded Puppy controls ethernet camera, records on USB

#3 Post by HairyWill »

QLeap wrote:Another effect of unexpectedly cutting power is that Puppy does not always boot X-Windows. Our custom software start-up scripts are in /root/.xinitrc and when X-Windows doesn't boot, our software doesn't start.
This is a feature, it is designed to stop a crash - reboot - crash... cycle if an invalid xorg.conf causes a crash, though its not very helpful in your situation.

There is a flag file /etc.XLOADED that only gets reset when X is shutdown properly. When xwin runs on boot it checks for the present of this file and reads its contents.

Your problem should be solved by simply adding
rm -f /etc/.XLOADED
to rc.local
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

User avatar
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

#4 Post by Pizzasgood »

Actually, we already worked this out. Starting X wasn't even needed, but the USB was only working right after running .xinitrc. He got that fixed with Raffy's help. Then I told him how to force the tmpfs to be copied whenever he wants, so it could be run whenever data needs to be "insured".

I don't know if I'm allowed to reveal what the project is about, but it's pretty cool :)
[size=75]Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]

User avatar
rarsa
Posts: 3053
Joined: Sun 29 May 2005, 20:30
Location: Kitchener, Ontario, Canada
Contact:

#5 Post by rarsa »

Pizzasgood wrote:Actually, we already worked this out.
And I hope you received your reward. Other than knowing that you did good ;)

This is the way Open Source can be self sustainable.
[url]http://rarsa.blogspot.com[/url] Covering my eclectic thoughts
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to

User avatar
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

#6 Post by Pizzasgood »

Yep. I would have gotten more, but I was pretty busy (two tests that week) so Raffy beat me to the USB fix (something about running delayedrun and sleeping afterwards).

Oh well :)
[size=75]Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]

raffy
Posts: 4798
Joined: Wed 25 May 2005, 12:20
Location: Manila

lots of possibilities

#7 Post by raffy »

Hey, so Pizza responded to the call. I had no idea that other members responded to this. :)

His system has a number of possible improvements, for example, the use of ext2 partition in the CF drive, but in the end, what was important to him was preventing the loading of the X server.

It was quite frustrating for him, as all forum advice told him that X was not needed to mount the USB, but in 2.13, USB detection had been transferred to .xinitrc, placed in another file named "delayedrun".
Puppy user since Oct 2004. Want FreeOffice? [url=http://puppylinux.info/topic/freeoffice-2012-sfs]Get the sfs (English only)[/url].

User avatar
ecomoney
Posts: 2178
Joined: Fri 25 Nov 2005, 07:00
Location: Lincolnshire, England
Contact:

restarting X

#8 Post by ecomoney »

Hi there, glad to see puppy being used in some more commercial projects.

With regards to starting X I believe I may have (been helped considerably to) come up with a solution, have a look here and in the links within that post. I seem to think however that when puppy is booted with no monitor, it seems to think there is a different monitor plugged in and re-runs the xorgwizard at bootup. You might try starting the computer with no monitor and waiting until the bootup script has computed (IDE drive light has stopped blinking), then plugging in the monitor and setting up the monitor, that way the auto-hardware detect/profiler will automatically load that monitor when it detects there isnt one present from then on. You can use the same pup_save file to transfer between machines. Your best bet might be to hack the xorgwizard script to always use xvesa as I think this works for almost every monitor/card setup.

With regards to writing to a flash drive, you may find that as a solution this doesnt work well as, unless you have a very expensive flash drive, flash drives only have the capacity for a limited number of writes. If you are working with intruder systems then you will obviously be concerned with the computer capturing the last image before whoever it is cuts the power lines? You might be better off with a small laptop hard disk attached to a USB caddy, or possible even one of these. I own one and its been great so far. Pretty good price per gigabyte too.

Another script you might want to take a look at (recently discovered) is the /etc/sbin/savepuppyd. This handles the automatic saving of data onto flash, but like I say you may be better off with a micro hard drive.

Its also possible, with a web connection to "monitor" the camera by setting up a simple http (read web) server, that way with the correct permissions a person can log into the machine and view the camera.

Interesting project, let me know if I can be of any help. Great Britain (where Im from) apparently has half of the worlds cameras!
Puppy Linux's [url=http://www.murga-linux.com/puppy/viewtopic.php?p=296352#296352]Mission[/url]

Sorry, my server is down atm!

User avatar
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

#9 Post by Pizzasgood »

Actually, the power being cut refers to the operator cutting the power, not a crook. Actually, given how this is going to be used it would be very entertaining to watch a crook attempting to disable the device, without not doing what he wanted to avoid being recorded doing. :lol:

If I understood everything correctly, there isn't even a way for the user to turn it off nicely, short of bringing his own keyboard and jacking in. Otherwise, I assume it's wired through a standard toggle switch that you just flip. Either that, or the current dies automatically when the engine turns off.
[size=75]Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]

User avatar
ecomoney
Posts: 2178
Joined: Fri 25 Nov 2005, 07:00
Location: Lincolnshire, England
Contact:

#10 Post by ecomoney »

here is some info about converting a pup_save.2fs file into ext3 format, ext3 has better handling of power cuts?
Puppy Linux's [url=http://www.murga-linux.com/puppy/viewtopic.php?p=296352#296352]Mission[/url]

Sorry, my server is down atm!

User avatar
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

#11 Post by Pizzasgood »

Well, it's running in mode 13, which means that the drive is only written to periodically. Then it was customized so that whenever it takes a picture it forces the drive to update. So theoretically there shouldn't be any issues unless it's turned off right after taking a picture, during the writing process.

Ext3 wouldn't hurt though.
[size=75]Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]

Post Reply