Show Posts
Pages: [1] 2 3 ... 22
1  Using Arduino / Programming Questions / Re: Any experience with run levels in linux and daemons? on: June 06, 2012, 01:32:06 pm

Got there in the end. Several things caught me out.

First, dirty test environment. I wasnt making sure that any processes started during testing were killed. Stupid mistake by me caused some confusion while trying to work out what was happening. Of course this shouldnt be able to happen if the pid files worked correctly. see Second point.

Second, pid files part 1, The skeleton bash script in init.d doesnt make it clear that pid files arnt created by start-stop-daemon when you give it the path to the pid file. You have to make sure that you set --make-pidfile to create the pid file or it assumes your service/daemon creates the pid file.

Third, pid files part 2, When start-stop-daemon is called with --make-pidfile, it doesnt know anything about any forking within your service/script. It creates the pid file with the pid before forking. So any further calls of start-stop-daemon wont work as the pid file is not associated with the forked process.

As I said got there in the end, just need to put the logic into my perl service/daemon to handle the pid file and locking rather than relying on the init.d script and start-stop-daemon as I assumed you could. Hopefully if someone else tries something like this, the above will help

2  Using Arduino / Programming Questions / Re: Any experience with run levels in linux and daemons? on: June 01, 2012, 10:21:05 am

Thanks for looking.

Good point running the bash init script directly, "/etc/init.d/zoneswitch start".
Dont know why I hadnt thought of that. I might get more of an idea of whats happening.

I can run the perl script directly, everything works as expected.

Run it through "service zoneswitch start". Daemon starts and stays started. I get all the debug info through syslog as expected but nothing goes over the serial/usb link to the arduino.

Ill give "/etc/init.d/zoneswitch start" a go and see what I get then. Maybe Ill see some errors or warnings this way.

Ive posted all the code on perl monks so rather than cluttering here up, it can be seen here:

3  Using Arduino / Programming Questions / Re: Any experience with run levels in linux and daemons? on: May 31, 2012, 11:52:10 am

I could give it a try, but I'd prefer to have it run from inet.d.
Ive posted on perl monks as well.
Ill keep plugging away.

4  Using Arduino / Programming Questions / Any experience with run levels in linux and daemons? on: May 30, 2012, 02:45:24 pm

Hi all,

Im having some problems using serial communication to my arduino from a daemon Ive written in perl running from init.d on a ubuntu box.

This is a headless server running the cctv system zoneminder.
The arduino is going in a switch box connected to the server by usb cable so the Scout leaders at the hut the cctv is covering can turn it on and off without having to touch a keyboard.

The daemon communicates over serial/usb to the arduino that has a key switch and a couple of status led's.
Ive set the daemon running under level 3 and above in the init.d bash script but im getting no response from the arduino script over serial.

If I run the perl script/daemon from the command line it works perfectly.
But not if I start it as a service via "service zoneswitch start".
So its something to do with init.d and the permissions/runlevels the perlscript/daemon is running under.

So Im wondering if anyone has any experience with daemons under linux, run levels and serial/usb and maybe can give me a pointer or two.
I can post the code but its a bit on the long side so Ill wait till someone requests it if it will be a help.


5  Community / Bar Sport / Re: Raspberry Pi launch farce on: March 01, 2012, 05:04:12 pm

Just tried Mikes code on both farnell and rs and it just points to the register interest pages.
I suspect that it may have been an oversight by the sites that has now been removed.
Good luck though.

6  Community / Products and Services / Re: Arduinos at Maplins on: February 17, 2012, 10:19:52 am

Interesting, Just looked at the maplin site.

They have books in stock and the android mega adk.
The main boards are on order.
But as usual with maplins the prices are a bit on the strong side.
But handy if you need something in a hurry, I have 2 stores with half an hour of home.

7  Using Arduino / General Electronics / Re: Can I use solderless breadboard with high voltage Nixie driver ic's on: February 16, 2012, 10:30:39 am

So probably best off using some veroboard/stripboard for the high voltage stuff then.
IC sockets, solder all of the high voltage wiring and the low voltage stuff connected to the stripboard so nothing can come lose or move about.

Sounds sensible, thanks for the advice.

8  Using Arduino / General Electronics / Can I use solderless breadboard with high voltage Nixie driver ic's on: February 16, 2012, 06:02:40 am


Im about to start playing around with some Nixie tubes for an Arduino powered clock.
Dont worry, Ill be careful of the high voltages needed to drive the tubes.
Hence the following question.

I want to plug the driver ic's into a standard solderless breadboard for now till I knock up a suitable pcb.
Will a standard solderless breadboard be capable of carrying the higher voltage needed to drive the nixie tubes?
Ill use separate boards to isolate the driver ic's and nixies from the low voltage arduino, supporting shields and other devices for the clock.
I just wanted to check before I start.
Otherwise Ill use some veroboard or something similar for the high voltage side.


9  Using Arduino / Sensors / Re: DS18B20 and occasional bogus readings on: January 03, 2012, 11:53:09 am

Im using about 3 metres of telephone wire, but only get the errors at start up.
None during the day or night while its running constantly.
Ive got mine running a web server and showing the last 24 hours readings.
Ive assumed its something to do with running it parasitic and something is happening with the power over the pins Ive connected it to.
But as its only on start up and the errors are obvious Im living with it.

10  Using Arduino / Sensors / Re: DS18B20 and occasional bogus readings on: December 31, 2011, 01:39:02 pm
Regarding the spurious values.

There is a crc error check you can do, that should sort this out but Ive not seen any published code using this.
Have a look at the data sheet.
Ive been lazy and just ignored the obvious spurious values.
So far All ive seen is the value 85.00 which is way out of bounds for internal or external temperature on my set up.

Just a
while(temp == 85.00)

Around your code to get the temp value from the sensor.

11  Using Arduino / Project Guidance / Re: Arduino + Ethernet Shield - web cache on: June 30, 2011, 11:33:37 am

Can you strip out some of the content on the page to make it small enough to store in ram till the sd card is ready?
A lot of the html would be redundant depending on what you want out of the 12k page.
Or maybe even pre process it to get the info you need then discard the rest.
Both of these methods would have to be done on the stream as it came in.

Or alternatively is there an I2c or serial storage device with more storage?

12  Community / Bar Sport / Re: Tinkering as a form of Therapy on: June 24, 2011, 05:07:39 pm
I can empathise. Im clinicaly knackered myself, ME/CFS, another managed untreatable condition.
Like having the Flu constantly with varying levels of pain, feeling knocked out,limited mobility and brain fog.
Had it for about 15 years now but had to give up work as a web developer about 5 years ago.
All the help you get is how to handle it and make the best of what youve got and try to stop the de-conditioning  of your whole system.
Apparently there was an ME/CFS awareness week a little while ago unfortunately no one told anyone about it.

Im playing with Arduino, Linux  and Android to keep my brain working since Ive had to give up work.
I manage a few hours a week when my concentration and memory arnt too bad.
Cant do the spannering I used to enjoy on my vehicles as I havnt got the strength or stamina.
I manage to work on my motorcycle a bit as I have a bike bench to lift it up to a working height.
But the Landrover hobby has been put on hold indefinitely.

But sitting at my bench with all the kit to hand I can get some real pleasure from knocking something up. As long as I dont loose track of the time Ive been working, overdo it and spend the next day or so recovering.

Let the clinically knackered unite, were not completely useless.


13  Community / Bar Sport / Re: Various whinging upon the expiration of my hard drive. on: June 24, 2011, 04:34:54 pm

Have a look at clonezilla and just copy the whole drive over to the new one.
Doesnt matter if the new drive is larger just expand the partition after the transfer.

I think my next Ubuntu upgrade will be either Xubuntu or Lubunto.
Still get the great install and hardware support out of the box but no Unity front end.
I dont like the new interfaces even my netbook running ubuntu netbook remix has standard gnome on the desktop.

14  Community / Bar Sport / Re: Hobby Electronics Magazines in UK - winge on: June 18, 2011, 09:53:16 am

Grumpy Mike,

Thats Selsdon in Surrey, South London.
Not up there in the barbarian north.
This is civilised shandy drinking country.

15  Community / Bar Sport / Re: Hobby Electronics Magazines in UK - winge on: June 17, 2011, 03:10:31 pm

My local newsagent in Selsdon stocks both elector and epe.
I can get them in WHSmith in central Croydon as well.

Have you tried asking the staff to stock it.

Pages: [1] 2 3 ... 22