Go to advanced search

by Bosse_B
Mon Feb 18, 2019 7:32 pm
Forum: Raspbian
Topic: Bash script command to check swap and show error?
Replies: 8
Views: 154

Re: Bash script command to check swap and show error?

Yes sed is not what I am fluent in.. And in this case you would also have to know the file that holds swap info as well as the way to find the data item... free as a general command seems a bit more in line with what I am comfortable with as well as the grep, head and tail commands. New to me this t...
by Bosse_B
Sun Feb 17, 2019 10:50 pm
Forum: Raspbian
Topic: Bash script command to check swap and show error?
Replies: 8
Views: 154

Re: Bash script command to check swap and show error?

Through googling I found that grep is capable of extracting data too. So this is the original command to get the Swap data: $ free | grep Swap Swap: 102396 9984 92412 If I feed the response string into another grep I get this: $ free | grep Swap | grep -P -o "[0-9]+" | head -1 102396 So this is what...
by Bosse_B
Sun Feb 17, 2019 8:13 pm
Forum: Raspbian
Topic: Bash script command to check swap and show error?
Replies: 8
Views: 154

Re: Bash script command to check swap and show error?

You could use AWK: free | awk '$1~/Mem/&&$2>1000000{print $2; exit 1}'; echo $?; That'll work within an if-then-else shell statement. I made some tests with this by putting it into a test.sh file. After changing Mem to Swap and 1000000 to 100000 the result I got was two lines: 102396 (this is the s...
by Bosse_B
Sun Feb 17, 2019 5:31 pm
Forum: Raspbian
Topic: Bash script command to check swap and show error?
Replies: 8
Views: 154

Bash script command to check swap and show error?

I have a script I use on new RPi units to install some software tools from source. It works really well provided that the swap is set to 1GB but I tend to forget this and if it is the standard 100M then the scripted build winds into a problem some 30 minutes later. The error message does not say it ...
by Bosse_B
Tue Jan 29, 2019 5:03 pm
Forum: General discussion
Topic: WiFi temperature sensor for RPi3?
Replies: 23
Views: 12584

Re: WiFi temperature sensor for RPi3?

This is my thread from Sept 2017...... Seems like it is not really in use of revival. I have solved my logging task in a different way (DIY). So, I can supply the following updated information concerning Temp/Humidity logging: 1) Using RPi as controller A DHT sensor type AM2302 can be connected dire...
by Bosse_B
Tue Jan 15, 2019 9:04 am
Forum: General discussion
Topic: Checking Internet connectivity in startup script?
Replies: 9
Views: 452

Re: Checking Internet connectivity in startup script?

Several reasons for the report: 1) To know the IP address in order to connect All of my RPi units are headless, and they are not always sitting on a network where I can manage the router DHCP reservations. And sometimes I move them to new networks and so I always put this on my RPi units to help in ...
by Bosse_B
Mon Jan 14, 2019 10:24 am
Forum: General discussion
Topic: Checking Internet connectivity in startup script?
Replies: 9
Views: 452

Re: Checking Internet connectivity in startup script?

Yes, I think I have it nailed now. The application is for a remote installation where the RPi is monitoring the temp/humid in our summer home. It is located remotely and uses a mobile broadband router. There are occasional power outages and for these the RPi will start up almost instantly when power...
by Bosse_B
Sun Jan 13, 2019 1:48 pm
Forum: General discussion
Topic: Checking Internet connectivity in startup script?
Replies: 9
Views: 452

Re: Checking Internet connectivity in startup script?

PS. Love Sweden. Beautiful country. I have been there twice with my wife in the last three years and hope to go again soon :-) Well, Stockholm has sent in its application for the 2026 Winter Olympics on Friday... Only one competitor, Italy, but they hosted the games in 2006 so maybe February 2026 c...
by Bosse_B
Sun Jan 13, 2019 11:55 am
Forum: General discussion
Topic: Checking Internet connectivity in startup script?
Replies: 9
Views: 452

Re: Checking Internet connectivity in startup script?

Thank you! This works as I want for these cases: OK - URL exists and responds (the one that will be used later in a curl call) NOK - URL exists but does not respond (my home router set to not respond to ICMP tests) NOK - URL does not exist so there will be a DNS error No extraneous output in this ca...
by Bosse_B
Sun Jan 13, 2019 10:03 am
Forum: General discussion
Topic: Checking Internet connectivity in startup script?
Replies: 9
Views: 452

Checking Internet connectivity in startup script?

As I have described in this thread (as yet not replied to) I need to call a php script on my website when my RPi starts up in order to report the IP address it has received. So I have written a shellscript, which is called in the startup process, and it works fine if the RPi is booted in a good envi...
by Bosse_B
Sat Jan 12, 2019 10:40 am
Forum: Raspbian
Topic: Detecting curl return error and wait in loop?
Replies: 0
Views: 439

Detecting curl return error and wait in loop?

I have a report script which runs on boot in order to send a message to myself when the RPi starts up containing the current IP address of the RPi. The script was created in order to be able to move the RPi between networks and after startup find its address easily to use when connecting with PuTTY ...
by Bosse_B
Wed Jan 09, 2019 8:45 pm
Forum: General discussion
Topic: Can RPi "cast" a video file to a Chromecast unit?
Replies: 3
Views: 238

Re: Can RPi "cast" a video file to a Chromecast unit?

OK, then it seems simpler to use an RPi box with OSMC (KODI) on the other TV and let it mount the drive on the main OSMC box as a network store to play from. Same approximate cost for a ChromeCast and an RPi, except I have a few RPi units in my lab which are seldom used.... Except: I have to figure ...
by Bosse_B
Wed Jan 09, 2019 12:08 pm
Forum: General discussion
Topic: Can RPi "cast" a video file to a Chromecast unit?
Replies: 3
Views: 238

Can RPi "cast" a video file to a Chromecast unit?

I have an RPi used as a media center with KODI (operating system OSMC). The user interface on this RPi is KODI as viewed via the attached HDMI screen (the TV in our living room). This server has a 1TB disk where I have collected a lot of videos like children's shows and science programs. The disk is...
by Bosse_B
Sun Jan 06, 2019 7:28 am
Forum: General discussion
Topic: No good at shellscripts, how to split data into an array?
Replies: 4
Views: 177

Re: No good at shellscripts, how to split data into an array?

You need to use curly brackets to let bash know that the array index is related to the variable otherwise it assumes the opening square bracket is the start of the next item and nothing to do with the variable. Also you might want to change how you create the array as your method will perform globb...
by Bosse_B
Sun Jan 06, 2019 7:24 am
Forum: General discussion
Topic: No good at shellscripts, how to split data into an array?
Replies: 4
Views: 177

Re: No good at shellscripts, how to split data into an array?

Why not have the PHP make a call to the AdafruitDHT.py using "system" or whatever PHP has. Then do all the splitting of the returned string in PHP? Sorry, I have not used PHP since about 2000 so I don't recall what facilities it has for running commands like that. The PHP script is a web server sid...
by Bosse_B
Sat Jan 05, 2019 11:43 pm
Forum: General discussion
Topic: No good at shellscripts, how to split data into an array?
Replies: 4
Views: 177

No good at shellscripts, how to split data into an array?

I am using an AdaFruit DHT library to read the humidity and temperature data from a sensor. When I call the library function it returns the following data on the command line: $ /home/pi/DHT/Adafruit_Python_DHT/examples/AdafruitDHT.py 22 4 T/H= 3.9 58.0 Now I want to process this in a shellscript an...
by Bosse_B
Fri Dec 07, 2018 7:49 pm
Forum: General discussion
Topic: How to read weather station sensor over 433MHz?
Replies: 17
Views: 864

Re: How to read weather station sensor over 433MHz?

As you are finding; 433MHz RF can be a lot more complicated and difficult than it first seems. Right you are! I also tested my car key to see if it was indeed a 433 MHz device, and it was. But to my surprise the protocol for the key seems extremely simple! No wonder car thieves can easily record ke...
by Bosse_B
Fri Dec 07, 2018 11:15 am
Forum: General discussion
Topic: How to read weather station sensor over 433MHz?
Replies: 17
Views: 864

Re: How to read weather station sensor over 433MHz?

I still have the receiver connected to my oscilloscope and I found that off the air there are seemingly other transmitter signals... It is hard to snatch because there is no way I have found to trigger on a reception because the receiver is outputting constant noise when there are no signal. I tried...
by Bosse_B
Wed Dec 05, 2018 11:17 pm
Forum: General discussion
Topic: How to read weather station sensor over 433MHz?
Replies: 17
Views: 864

Re: How to read weather station sensor over 433MHz?

Links in the description for the RTL-SDR Dongle did not work.
Seems to be a hard found item, at least for me in Sweden.
Is it not possible to use rtl_433 without an SDR dongle, just using a 433 MHz receiver hooked to a GPIO pin on the RPi?
by Bosse_B
Wed Dec 05, 2018 4:23 pm
Forum: General discussion
Topic: How to read weather station sensor over 433MHz?
Replies: 17
Views: 864

Re: How to read weather station sensor over 433MHz?

OK, that is what I figured too. It was really tedious work capturing the packets with the oscilloscope and then manually inspecting the waveforms for 1 or 0 values. I made 13 such deconings without being wiser except for the channel indicator bits I found inside the packet. If I had designed the pac...
by Bosse_B
Wed Dec 05, 2018 7:14 am
Forum: General discussion
Topic: How to read weather station sensor over 433MHz?
Replies: 17
Views: 864

Re: How to read weather station sensor over 433MHz?

I planned on doing the detective work on the Pi but then porting the results over to Arduino using the ESP8266 WiFi module as target. The ESP is already present serving wired sensors (3 of them) but I cannot get access to install more sensor wires anymore, the construction is now closed up too much....
by Bosse_B
Tue Dec 04, 2018 10:22 pm
Forum: General discussion
Topic: How to read weather station sensor over 433MHz?
Replies: 17
Views: 864

Re: How to read weather station sensor over 433MHz?

Bump, double post edited
by Bosse_B
Tue Dec 04, 2018 9:20 pm
Forum: General discussion
Topic: How to read weather station sensor over 433MHz?
Replies: 17
Views: 864

Re: How to read weather station sensor over 433MHz?

I have hooked up the receiver on a breadboard now and connected an oscilloscope to its output. The situation is as follows: Whenever nothing is transmitting the receiver outputs a lot of noise. When I activate the Tx button on the temp/humid sensor the data on the receiver output stabilizes into a b...
by Bosse_B
Tue Dec 04, 2018 12:51 pm
Forum: General discussion
Topic: How to read weather station sensor over 433MHz?
Replies: 17
Views: 864

Re: How to read weather station sensor over 433MHz?

Which is your problem To get the raw data stream into the RPi or to decode that into readable figures? If the latter then AFAIK there is no standard encoding used by all makers of sensors and stations. Getting the raw output into the Pi is just a matter of hooking the receiver output to a suitable ...
by Bosse_B
Tue Dec 04, 2018 10:45 am
Forum: General discussion
Topic: How to read weather station sensor over 433MHz?
Replies: 17
Views: 864

How to read weather station sensor over 433MHz?

I want to read the output (temp + humidity) of a couple of weather station sensors which use the 433 MHz frequency. I have a receiver like this: 433MHzRx.png The sensors are from a weather station (no brand except for the chain tha sell them) and they can be bought separately at a low cost. The labe...

Go to advanced search