Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Mon 20 Oct 2014, 17:35
All times are UTC - 4
 Forum index » Taking the Puppy out for a walk » Misc
My project remote monitoring pc audio and alarm
Moderators: Flash, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 2 of 2 [23 Posts]   Goto page: Previous 1, 2
Author Message
AdrianH

Joined: 17 Oct 2013
Posts: 61
Location: Blackburn in the UK

PostPosted: Mon 11 Nov 2013, 17:26    Post subject:  

Seaside.

Thanks for the post, I will have a general read but will not be able to use basic or C at the present, a bit outside my knowledge.

I think.I guess my next thing I will be doing is converting the decimal numbers into some sort of hex mask so I can then test individual bits.

I have access to
D3 =8
D4 =16
D5 =32
D6 =64
D7 =128

Pins D0, D1 and D2 are internal and can change on there own. In fact D0 = 1 does change from time to time.

My next major will be when I get my Alarm keyfob and relays to try, awaiting delivery from China or HK, then I will check operation and put into use, in the interim I will be trying to smarten the code up and put a few checks in to determine if the network and all the other services are up (If I can).

Adrian
Back to top
View user's profile Send private message 
AdrianH

Joined: 17 Oct 2013
Posts: 61
Location: Blackburn in the UK

PostPosted: Thu 14 Nov 2013, 19:00    Post subject:  

Have done a bit more tonight on the perl script

Code:
#!/bin/sh
# run try number 5
# This is a test script
# Pin resides in /bin
# Normal use is pin 0x379  where 0x379 is the status port in hex format
# Can not use port0x379 it has to have the space as the port number is a variable passed to pin
# result shpould be the response typically 120 decimal
# hope to use result as part of a if else and loop
# in run5 have done a conversion from decimal input to descrete values D7 to D0
# D3 to D0 will never get used in this application, but done for completeness
# This now means I can test  each of the upper five status bits of the status port

status=0x379   # The number for the status port
smsdone=0   # To determine if sms message has been sent
debounce=0   # A Bit of software debounce

while :
do
#   echo "infinite loops  hit CTRL+C to stop"

result=$(/bin/pin $status)   # The result of reading the status pins # Line 21
#echo $result
x=$result
y=$(expr $x - 128)
if test $y -ge 0
   then D7=1
   x=$y
   else D7=0
fi
y=$(expr $x - 64)
if test $y -ge 0
   then D6=1
   x=$y
   else D6=0
fi
y=$(expr $x - 32)
if test $y -ge 0
   then D5=1
   x=$y
   else D5=o
fi
y=$(expr $x - 16)
if test $y -ge 0
   then D4=1
   x=$y
   else D4=0
fi
y=$(expr $x - 8)
if test $y -ge 0
   then D3=1
   x=$y
   else D3=0
fi
y=$(expr $x - 4)
if test $y -ge 0
   then D2=1
   x=$y
   else D2=0
fi
y=$(expr $x - 2)
if test $y -ge 0
   then D1=1
   x=$y
   else D1=0
fi
y=$(expr $x - 1)
if test $y -ge 0
   then D0=1
   x=$y
   else D0=0
fi
#echo "D7= "$D7         # Line 72
#echo "D6= "$D6         # Clear the #'s to see results
#echo "D5= "$D5
#echo "D4= "$D4
#echo "D3= "$D3
#echo "D2= "$D2
#echo "D1= "$D1
#echo "D0= "$D0
#echo "  "

if test $D7 -eq 1 && test $debounce -eq 5 && test $smsdone -eq 0   # Now testing the D7 bit Line 82
   then         # To be at this point, the contacts have been closed for 500 mS
   /usr/etc/one      # And the sms gateway has not been used
   /usr/etc/psms1      # The computer emits a sequence of 'beep' musical sounds
   smsdone=1      # The sms gateway will be accessed to 'page' mobiles
   debounce=0

elif test $smsdone -eq 1   # Line 89
   then sleep 120      # Sleep for 2 minutes
   smsdone=0

elif test $D7 -eq 1 && test $smsdone -eq 0    # Line 93
   then debounce=$(expr $debounce + 1)
   usleep 100000
#   echo $debounce

else
#   echo "No"      # Line 99
   debounce=0
   usleep 100000

fi            # Line 102

done


This allows me to test each bit by testing D0 to D7 although I can only access D3 to D7 on the status port, it means in the future I could test for 5 different inputs

Adrian
Back to top
View user's profile Send private message 
AdrianH

Joined: 17 Oct 2013
Posts: 61
Location: Blackburn in the UK

PostPosted: Sat 16 Nov 2013, 17:32    Post subject:  

Well the monitor was installed today and works, a trial run went OK.

I used amarok on a home pc at my end (suse11.4) to listen to the audio as I found this to give the least latency, I have tried puppyradio and it does work but the latency is several seconds probably due to having so much cache for audio and not being able to reduce it less then 64K, when the audio is only requiring 4K bandwidth 16 to 17 seconds is a long wait.

I will have to now get another thin client as my spare had intermittent receive audio and I now need another to play, test, improve on.

Tempted to try and have a cron job to send me a text at a set time every morning to at least let me know it is on line and functioning.

Adrian
Back to top
View user's profile Send private message 
AdrianH

Joined: 17 Oct 2013
Posts: 61
Location: Blackburn in the UK

PostPosted: Sun 24 Nov 2013, 17:43    Post subject:  

A bit of an update on the previous post first.

I found that command line of mplayer with the -nocache option gave as good a delay as amarok on suse. pity I do not seem to be able to remove the minimum 64 K option when in X.

Mum is currently in hospital has been since Monday so evenings and weekends have been hectic with visiting and sorting things out.

I recently got two more HP thin clients same type and as before they have 192Meg Flash and 256 Meg Ram

This equates to around 174.7 Meg after formatting and boot loader on the flash and 240 Meg ram after the video take 10 plus Meg for its use.

This is not enough for me to install Slacko Puppy the non PAE version in hardware without upgrading the memory.

I have been trying to remove as many of the applications as I can to get the size down and been doing a remastered iso. The best I managed to get down to was 157.4 Meg which I thought was not bad considering I also have a sfs file for perl provided by 01micko in there, but a frugal install, changing start-up settings etc still takes it so I have less then 3 meg of spare space on the flash and the computer is no longer reliable and dies.

I have been looking at Tinycore Linux, but Icecast, darkice, ssh server, and rsound are not available. It was Monsie that did the rsound as a pet for me.

I need to fathom if I can get rid of all the X components and just have a slacko puppy that is pure console, and then figure out if I can install pets from command line and set everything else up from CLI.

Tiny core does not have a file layout I can figure.

Adrian
Back to top
View user's profile Send private message 
mikeb


Joined: 23 Nov 2006
Posts: 8342

PostPosted: Sun 24 Nov 2013, 18:11    Post subject:  

Aye up...

Space the final distro frontier.

There are some smaller pups around ... mine are more like 100MB and there are plenty of others... might save you some strip time.

From your doings there is noting particularly in need of this weeks system so an older one might be fine if smaller.

You could strip out the Xorg side of X and leave Xvesa which would save quite a bit of space but leave a desktop for setting up.
You can install command line I believe but never tried it with pets...

Another big size bunny are drivers...especially wifi and their associated firmware so big savings can be made if not needed or only one type is.

Slitaz is another small one IF it does what you want...sometimes its worth persevering with the familiar.

mike
Back to top
View user's profile Send private message 
AdrianH

Joined: 17 Oct 2013
Posts: 61
Location: Blackburn in the UK

PostPosted: Sun 24 Nov 2013, 18:38    Post subject:  

Hi Mike.

The reason I use slacko 5.6 was that was the only one of the current Puppy distro's I could get SSH server working. And as people have been kind to assist with the add ons by way of pets the plan is to stay with Puppy,

I have been searching on web for a small distro, but many require lots of knowledge! Embarassed

I have been confused by the option to create a zdrv when remastering, not having one and amending the /etc folder to be more for my hardware has led to smaller ISO's

Ebay memory will probably be my friend again, unless there becomes a thinslacko 5.6.

I guess I am after a headless version? I have read posts on command line pet installation but they always seem to call X, unless I read them wrong.

There was also a zdrv_cutter.pet to remove unwanted kernel modules I think.

What ever don’t buy any Oracle Sun ray 2's even if they are extremely cheap. No use for anything else.

Adrian
Back to top
View user's profile Send private message 
mikeb


Joined: 23 Nov 2006
Posts: 8342

PostPosted: Sun 24 Nov 2013, 20:01    Post subject:  

Okay dokay.

Well I just used the ssh/sshfs server from slax , made it into a 350k sfs and merged it into puppy 4 so probably good for any puppy from the last few years if you ever have the need.

Pretty sure there are headless stripped down jobbies around here... I mean something 30-50MB should do the job...not like you need 90% of the stuff in there though its not always obvious what can be removed if you are unfamiliar.

Once you get the wrinkles ironed out a system like this might prove to be a little on the popular side Wink

Hope mum's feeling a bit better,

regards

Mike
Back to top
View user's profile Send private message 
AdrianH

Joined: 17 Oct 2013
Posts: 61
Location: Blackburn in the UK

PostPosted: Wed 08 Jan 2014, 17:24    Post subject:  

I have not forgotten the group and will get on with more work on the monitor when I can to sort of finish off and present information to others if a similar thing is required.

Mum was moved to nursing care on the 21st December. The house is now empty, so the computer allows me to listen in to the house for a while to check all sounds OK.

Had to update the fire wall blacklist a few times to restrict other countries including some IP's from Germany.

If I replaced the pendent output with an output from a alarm type movement sensor it would act as an intruder detector and send me a text. I do have mums neighbours looking out for problems for me anyway.

Hope you all had a good festive time over the season.

Best wishes to all

Adrian
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 2 of 2 [23 Posts]   Goto page: Previous 1, 2
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Taking the Puppy out for a walk » Misc
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0717s ][ Queries: 11 (0.0037s) ][ GZIP on ]