Go to advanced search

by buja
Sat Jan 13, 2018 7:49 am
Forum: Beginners
Topic: Autorun terminal commands at boot
Replies: 2
Views: 111

Re: Autorun terminal commands at boot

by buja
Thu Jan 11, 2018 5:14 pm
Forum: C/C++
Topic: Timer that counts more than a second
Replies: 7
Views: 250

Re: Timer that counts more than a second

Double.
by buja
Thu Jan 11, 2018 5:13 pm
Forum: C/C++
Topic: Timer that counts more than a second
Replies: 7
Views: 250

Re: Timer that counts more than a second

Seems to be a handy function, alarm(). I made an example program to find out how it works. /* alarm.c */ #include <stdio.h> #include <signal.h> #include <stdlib.h> #include <unistd.h> #define BUF_SIZE 200 static void handler(int sig) { printf("Caught signal\n"); /* UNSAFE - see Section 21.1.2) */ } ...
by buja
Wed Jan 10, 2018 4:34 pm
Forum: Wanted
Topic: WANTED: Conquer the Command Line - Richard Smedley
Replies: 7
Views: 378

Re: WANTED: Conquer the Command Line - Richard Smedley

The book is available at Amazon UK, but the price is quite high. https://www.amazon.co.uk/Conquer-Command-Line-Richard-Smedley/dp/1908256850/ref=pd_rhf_gw_p_img_5?_encoding=UTF8&psc=1&refRID=7F6BQANDNQYBMC8T0664 Don't forget, soon after releasing this book, Raspbian went from Wheezy to Stretch, maki...
by buja
Fri Dec 22, 2017 6:51 pm
Forum: C/C++
Topic: stretch wiringpi
Replies: 24
Views: 774

Re: stretch wiringpi

wiringPi comes with Raspbian, it is installed by default. You can check if it is there by asking APT (the package manager) and by checking the contents of the directory with the system libraries. dev@rpi:~/wiringpi $ apt search wiringpi Sorting... Done Full Text Search... Done wiringpi/stable,now 2....
by buja
Fri Dec 22, 2017 6:09 pm
Forum: C/C++
Topic: stretch wiringpi
Replies: 24
Views: 774

Re: stretch wiringpi

I think you have to make a choice between the wiringPi from Github and the wiringPi that comes standard with Raspbian.
Choose one, delete the other.
by buja
Fri Dec 22, 2017 1:21 pm
Forum: C/C++
Topic: stretch wiringpi
Replies: 24
Views: 774

Re: stretch wiringpi

Maybe -lwiringPiDev?
(I came up with this after a quick look in Synaptic to check the installed files)
by buja
Wed Dec 20, 2017 9:09 am
Forum: Troubleshooting
Topic: Execute a python file from Gammu
Replies: 4
Views: 130

Re: Execute a python file from Gammu

The shebang line should go in the python file.
I would keep the .py extension, makes it more clear. You don't need a separate .sh file.
by buja
Wed Dec 20, 2017 5:22 am
Forum: Troubleshooting
Topic: Execute a python file from Gammu
Replies: 4
Views: 130

Re: Execute a python file from Gammu

Does your Python script start with the so called shebang? Example 1: without shebang line. # example1.py print('Run this with the python command') To run example 1 you must give this command: python3 example1.py Example 2: with shebang line, you run this without specifying the Python interpreter on ...
by buja
Mon Dec 18, 2017 6:42 pm
Forum: General discussion
Topic: micro sd keeps becoming corrupt
Replies: 6
Views: 359

Re: micro sd keeps becoming corrupt

It's certainly not normal that (new) SD cards fail often.

I guess the first thing to look at is the power supply. Do you often see lightning bolts on the screen (they indicate low voltage)?
Power failures may damage your SD card.
For a Pi 3 a 2.5 A power supply is recommended.
by buja
Wed Dec 13, 2017 11:51 am
Forum: Python
Topic: SDS021 sleep/wake with python
Replies: 3
Views: 293

Re: SDS021 sleep/wake with python

I hope to receive my SDS021 soon, I am surprised the datasheet does not mention how to go to sleep mode. Maybe is the same as the SDS011 sensor for which I found this datasheet: https://www.google.nl/url?sa=t&rct=j&q=&esrc=s&source=web&cd=3&cad=rja&uact=8&ved=0ahUKEwij4azO9YbYAhUCI1AKHRdfA0IQFgg3MAI...
by buja
Mon Dec 11, 2017 7:53 pm
Forum: General discussion
Topic: Help! - I need to launch LXTerminal at startup on the desktop.
Replies: 6
Views: 355

Re: Help! - I need to launch LXTerminal at startup on the desktop.

To launch LXTerminal at startup on the desktop you must add a line to the autostart file, which is in your personal configuration directory. nano ~/.config/lxsession/LXDE-pi/autostart You should see a couple of lines starting with @, add a line with 'x-terminal-emulator': @lxpanel --profile LXDE-pi ...
by buja
Fri Dec 08, 2017 11:38 am
Forum: C/C++
Topic: how to update or reinstall wiringPi of either prior installation source
Replies: 33
Views: 1563

Re: how to update or reinstall wiringPi of either prior installation source

I understand what you mean, but you should not expect that. The examples you mention all have in common that they are easy to use as long as you stick to the use case the makers had in mind, the perfect regular consumer. This consumer should stay inside the box and use the package manager to install...
by buja
Fri Dec 08, 2017 10:03 am
Forum: C/C++
Topic: how to update or reinstall wiringPi of either prior installation source
Replies: 33
Views: 1563

Re: how to update or reinstall wiringPi of either prior installation source

System stuff in system folders, user stuff in local folders. wiringPi is wiringPi (analogously similar programs and libs), so why have 2 different install root dirs and 1 extra in a home dir? But after all that wouldn't matter if there was a system GUI dashboard for overview and uninstall functions...
by buja
Sat Dec 02, 2017 9:27 am
Forum: C/C++
Topic: Undefined reference to main / Undefined reference to 'some_function'
Replies: 5
Views: 384

Re: Undefined reference to main / Undefined reference to 'some_function'

What happens if you give this command (fill in your own filenames here): gcc -o main main.c module.c This should produce an executable file with the main , which you can run. Building (=making an executable file) only main.c fails because it contains functions that are defined in module.c, and the c...
by buja
Fri Dec 01, 2017 7:05 pm
Forum: C/C++
Topic: A simple weather/environmental data collector in C
Replies: 10
Views: 560

Re: A simple weather/environmental data collector in C

Yeah, totally impossible to find something :?: Oh wait, I just ordered a BME 680 from Pimoroni (link: https://shop.pimoroni.com/products/bme680). The description has two links to Github sites, one with a Python library and one with a C library ;) (C library by Bosch, the manufacturer of the sensor)
by buja
Thu Nov 30, 2017 7:03 pm
Forum: Beginners
Topic: Connect to laptop
Replies: 5
Views: 260

Re: Connect to laptop

If with "connect to laptop" you mean controlling the Pi from the laptop: yes that is possible. Here are some useful links: 1. https://www.raspberrypi.org/documentation/remote-access/ 2. https://www.raspberrypi.org/documentation/remote-access/vnc/README.md Link 2 is about VNC. In short: connect your ...
by buja
Thu Nov 30, 2017 7:17 am
Forum: C/C++
Topic: A simple weather/environmental data collector in C
Replies: 10
Views: 560

Re: A simple weather/environmental data collector in C

Interesting stuff! On your Github page on the CS811 sensor you mention it is not working flawlessly with the Raspberry Pi. The Pi Hut sells this sensor and on their website ( https://thepihut.com/products/adafruit-ccs811-air-quality-sensor-breakout-voc-and-eco2 ) they say: Finally, this chip (CS811)...
by buja
Wed Nov 29, 2017 9:09 pm
Forum: Beginners
Topic: pygame in geany (c) possible?
Replies: 4
Views: 247

Re: pygame in geany (c) possible?

It's really simple (example in Python 2): # Just giving sensorValue some number to work with sensorValue = 105 voltage = sensorValue * 5.0 / 1023.0 print voltage # Or for Python 3: print(voltage) It's not that much different from C. By the way, Geany is just an editor, a nice editor with some handy ...
by buja
Wed Nov 29, 2017 6:09 pm
Forum: Raspbian
Topic: sudo apt-get update fails
Replies: 4
Views: 318

Re: sudo apt-get update fails

Welcome :lol:
by buja
Tue Nov 21, 2017 7:30 am
Forum: General discussion
Topic: Raspberry PI official wireless dongle
Replies: 4
Views: 220

Re: Raspberry PI official wireless dongle

I have a Pi 2B with an official RPi WiFi dongle running Raspbian Stretch. It works without any problems.
In fact, when I upgraded from Jessie to Stretch I did not pay any attention to it, worked right out of the box.

This is my weather station, so it runs 24/7.
by buja
Sat Nov 18, 2017 3:18 pm
Forum: C/C++
Topic: how to update or reinstall wiringPi of either prior installation source
Replies: 33
Views: 1563

Re: how to update or reinstall wiringPi of either prior installation source

If wiringPi was installed from the package manager, APT knows about it. apt list wiringpi Listing... Done wiringpi/stable,now 2.44+1 armhf [installed] This shows wiringPi was installed through APT, and any updates will be automatically handled by APT. But this is with Raspbian Stretch, if you are st...
by buja
Sun Oct 29, 2017 7:02 pm
Forum: Python
Topic: Graphic window for python GTK compiler Geany
Replies: 6
Views: 354

Re: Graphic window for python GTK compiler Geany

I am afraid the Geany part is the only thing I can help you with, I hope someone else can help you with the graphical part of your question.
by buja
Sun Oct 29, 2017 4:46 pm
Forum: Python
Topic: Graphic window for python GTK compiler Geany
Replies: 6
Views: 354

Re: Graphic window for python GTK compiler Geany

I think you will find this useful: https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=191818#p1203549 With the upgrade to Raspbian Stretch something has changed in the behaviour of either Geany or lxterminal, and because of that the terminal dow does not work properly anymore. But it's an easy ...
by buja
Sat Oct 28, 2017 10:37 am
Forum: C/C++
Topic: Problem with Geany - 'execute' command displays blank terminal window
Replies: 6
Views: 708

Re: Problem with Geany - 'execute' command displays blank terminal window

I think you will find the solution here: https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=191818#p1203549 buja, the link you posted is about Python. No, it's not. While the original poster had this problem with Python, I had the same problem with C after upgrading to Raspbian Stretch. The so...

Go to advanced search