Go to advanced search

by timmoore46
Thu Mar 07, 2013 7:19 pm
Forum: General discussion
Topic: PIR Sensor
Replies: 34
Views: 5033

Re: PIR Sensor

http://www.ebay.co.uk/itm/140922588990? ... 1438.l2649

seems very good value !

Did not know they existed !

:D

Tim
by timmoore46
Mon Mar 04, 2013 8:32 am
Forum: General discussion
Topic: Bash script works but strange message
Replies: 58
Views: 7281

Re: Bash script works but strange message

Polish is always good !

Many thanks

:D :D :D :D :D

Tim
by timmoore46
Mon Mar 04, 2013 6:30 am
Forum: General discussion
Topic: Bash script works but strange message
Replies: 58
Views: 7281

Re: Bash script works but strange message

Well as predicted the program worked first time ! The way the hardware for the light sensor worked is a logic '0' for 'y' says there is loads of sunshine, so turns the relay on and 'z' logic '1' says there is not enough. so the result of what is needed to prevent relay chatter is a truth table:- y z...
by timmoore46
Sun Mar 03, 2013 2:02 pm
Forum: General discussion
Topic: Bash script works but strange message
Replies: 58
Views: 7281

Re: Bash script works but strange message

I use Bless Hex Editor for finding nasties. I will try out your recommendations after 6pm as its Sunny and the logfile is giving me a reference to when the relay kicks out. I built in hysteresis into the sensor electronics, but have not measured what it achieves yet. It trips in fine , but its the o...
by timmoore46
Sun Mar 03, 2013 1:20 pm
Forum: General discussion
Topic: Bash script works but strange message
Replies: 58
Views: 7281

Re: Bash script works but strange message

I checked that, but will recheck it it does not seem to like the '; ' before then 'then' _____ this is my source :- #!/bin/bash declare -i y declare -i z while true ; do # Read in two input, must be numerical otherwise 0   printf "y? "; read y   printf "z? "; read z # One way of doing an AND   if [ ...
by timmoore46
Sun Mar 03, 2013 12:42 pm
Forum: General discussion
Topic: Bash script works but strange message
Replies: 58
Views: 7281

Re: Bash script works but strange message

[email protected]:~/logic$ ./logic_AND_001
./logic_AND_001: line 13: syntax error near unexpected token `then'
./logic_AND_001: line 13: `  if [ "$y" = "1" ] && [ "$z" = "1" ] ; then'


???
by timmoore46
Sun Mar 03, 2013 12:03 pm
Forum: General discussion
Topic: Bash script works but strange message
Replies: 58
Views: 7281

Re: Bash script works but strange message

Many thanks again ! :D :D :D :D :D :D

Will try that out !

Tim

update:-

PS the results (surprising) are on page 2 of this thread.
by timmoore46
Sat Mar 02, 2013 7:56 am
Forum: Beginners
Topic: Bash - what next ?
Replies: 25
Views: 3688

Re: Bash - what next ?

An update on the software to drive the hardware:- (be warned both the software and hardware are going to be tuned, so always message me for the latest info) For anyone who has followed this thread here is the current working script. Its purpose is to read the status of a light intensity giszmo and i...
by timmoore46
Sat Mar 02, 2013 7:50 am
Forum: General discussion
Topic: Bash script works but strange message
Replies: 58
Views: 7281

Re: Bash script works but strange message-Fixed

For anyone who has followed this thread here is the current working script. Its purpose is to read the status of a light intensity giszmo and if the light is strong enough turn on a relay to divert the power of a 16 solar panels to a 2.7 kw immersion heater. a logfile is created so I can see what ea...
by timmoore46
Fri Mar 01, 2013 5:08 pm
Forum: General discussion
Topic: Bash text colours - need monochrome - help !
Replies: 4
Views: 2292

Re: Bash text colours - need monochrome - help !

Ah ! You save the day yet again !

Many thanks !

:D :D :D :D

Tim
by timmoore46
Fri Mar 01, 2013 1:18 pm
Forum: General discussion
Topic: Bash script works but strange message
Replies: 58
Views: 7281

Re: Bash script works but strange message

I often think solving problems is about stumbling into "nuggets of Gold !" ./logfile_025 | tee script_output.log was the total answer to final part of this logfile project ! same as moving away from the root directory to the pi directory was:- sudo sh -c ' etc etc etc' I would never have got there w...
by timmoore46
Fri Mar 01, 2013 12:55 pm
Forum: General discussion
Topic: Bash script works but strange message
Replies: 58
Views: 7281

Re: Bash script works but strange message

Many thanks ! I've downloaded the book. Just need a Tardis now !

:D :D :D :D

Tim
by timmoore46
Fri Mar 01, 2013 7:56 am
Forum: General discussion
Topic: Bash script works but strange message
Replies: 58
Views: 7281

Re: Bash script works but strange message

Many thanks again ! A bit more polish ! :D :D :D :D Any thoughts on how to get the logfile to contain anything that is sent to the console. I got the 'date' function to go in ok, but failed abysmally to get anything else. The shape of the script is a big 'do loop', with all the code inside of it wit...
by timmoore46
Fri Mar 01, 2013 7:44 am
Forum: General discussion
Topic: Getting Nano into monochrome !
Replies: 9
Views: 1984

Re: Getting Nano into monochrome !

nanorc dealt with color here:- ## Color setup ## ## Format: ## ## syntax "short description" ["filename regex" ...] ## ## The "none" syntax is reserved; specifying it on the command line is ## the same as not having a syntax at all. The "default" syntax is ## special: it takes no filename regexes, a...
by timmoore46
Fri Mar 01, 2013 7:41 am
Forum: General discussion
Topic: Bash text colours - need monochrome - help !
Replies: 4
Views: 2292

Re: Bash text colours - need monochrome - help !

found in etc

bash.bashrc

but could not find that line there.

unalias ls from bash worked a treat !

Many thanks !

:D :D :D :D :D

Tim
by timmoore46
Fri Mar 01, 2013 5:17 am
Forum: General discussion
Topic: Bash text colours - need monochrome - help !
Replies: 4
Views: 2292

Bash text colours - need monochrome - help !

colour has appeared in this:-

[email protected] ~/master $ ls
control_004.log logfile_0012 logfile_0014 logfile_002 logfile_022 logfile_024 y z
[email protected] ~/master $

but as I'm colour blind it makes about half of it unreadable.

How do I get it all to be black ?

A puzzled,

Tim
by timmoore46
Fri Mar 01, 2013 4:37 am
Forum: General discussion
Topic: Bash script works but strange message
Replies: 58
Views: 7281

Re: Bash script works but strange message

In the full listing of the source code of my program are several instances of this sort of command echo "y is :-" ; cat y (it would be nice if the result of cat y was on the same line as "y is :-" ) now so far the only bit of the logfile that works is:- logFile="control_004.log" echo "$(date)" | tee...
by timmoore46
Thu Feb 28, 2013 5:47 pm
Forum: General discussion
Topic: Bash script works but strange message
Replies: 58
Views: 7281

Re: Bash script works but strange message

sudo sh -c 'echo "4" > /sys/class/gpio/export' did the job ! Now all that is left is to get anything that is sent to the screen to wind up in the logfile 'control_004.log ' Only the time stamp does at the moment ! variable y and z is what is needed in the logfile. VERY VERY MUCH APPRECIATED !!!!! :D...
by timmoore46
Thu Feb 28, 2013 11:53 am
Forum: General discussion
Topic: Bash script works but strange message
Replies: 58
Views: 7281

Re: Bash script works but strange message

I did a long time ago 5 weeks ? install the wiring diagram. Very very interesting ! Many thanks again. I was operating from the pi directory subdirectory master. I always follow the golden rule " if it works leave it alone", I'm not sure what effect changing "4" to 4 will have, so not keen to do tha...
by timmoore46
Thu Feb 28, 2013 9:32 am
Forum: General discussion
Topic: Bash script works but strange message
Replies: 58
Views: 7281

Re: Bash script works but strange message

I meant the code without the introduction of the logfile and moving from root to pi. Well the error message has changed:- Thu Feb 28 09:26:59 UTC 2013 /bin/bash: echo "7" > /sys/class/gpio/export ; echo "in" > /sys/class/gpio/gpio7/direction: No such file or directory cat: /sys/class/gpio/gpio7/valu...
by timmoore46
Wed Feb 27, 2013 1:30 pm
Forum: Beginners
Topic: Bash - what next ?
Replies: 25
Views: 3688

Re: Bash - what next ?

Update on the input board circuit diagram.

I'm going to use two of them to control the point of switching on and also point of switching off.

Software will take another month... maybe...

Image

:D :D :D

Tim
by timmoore46
Wed Feb 27, 2013 12:50 pm
Forum: General discussion
Topic: Bash script works but strange message
Replies: 58
Views: 7281

Re: Bash script works but strange message

Wow ! Brilliant ! Its part of a solar panel gizmo that is aimed to send surplus energy to an immersion system. As it works, I've got it doing just that. When it is off-duty tonight I'll put your suggestion into the code. Many many thanks for all your help ! Much needed ! :D :D :D :D :D :D :D :D :D :...
by timmoore46
Wed Feb 27, 2013 12:02 pm
Forum: General discussion
Topic: Bash script works but strange message
Replies: 58
Views: 7281

Re: Bash script works but strange message

GPIO all works well in the root directory source code [email protected] ~/master $ cat logfile_002 #! /bin/sh # chmod a+x logfile_002 # control c stops the program # Font:- DejaVu sans mono while true do logFile="control_004.log" echo "$(date)" | tee -a $logFile #setup Input sudo -s echo "7" > /sys/cla...
by timmoore46
Wed Feb 27, 2013 11:07 am
Forum: General discussion
Topic: Bash script works but strange message
Replies: 58
Views: 7281

Re: Bash script works but strange message

I copy and pasted the scripy currently called logfile_002 followed the instructions:- Wed Feb 27 11:04:50 UTC 2013 ./logfile_002: 21: ./logfile_002: cannot create /sys/class/gpio/export: Permission denied ./logfile_002: 23: ./logfile_002: cannot create /sys/class/gpio/gpio7/direction: Permission den...

Go to advanced search