Go to advanced search

by erondem
Mon Jul 01, 2019 7:59 am
Forum: Python
Topic: Doing multiple jobs at the same time
Replies: 3
Views: 462

Re: Doing multiple jobs at the same time

It is not clear from the code you provided, but your main method which contains a while True loop may be blocking the GUI. Tkinter has its own event loop and you probably should incorporate your while True loop into the tkinter loop by using the tkinter "after" method. Here is one article that prov...
by erondem
Wed Jun 26, 2019 3:12 pm
Forum: Python
Topic: Doing multiple jobs at the same time
Replies: 3
Views: 462

Doing multiple jobs at the same time

Hi I am running a card reader program in my Raspberry Pi with Python. I've reader which waits for card and when there is card on the reader It sends couple of information to the server and it takes 3-4 seconds. For this 3-4 seconds reader does not work because of response of request. And when card a...
by erondem
Fri Apr 12, 2019 7:25 am
Forum: Beginners
Topic: Defining multiple static ip
Replies: 1
Views: 146

Defining multiple static ip

Hi, I am wondering this, I am defining static ip using /etc/dhcpdc.conf file with this syntax interface wlan0 static ip_address=10.0.2.20 static routers=10.0.2.1 static domain_name_servers=192.168.10.45 192.168.15.10 My customer changes network's dhcp rules without letting me know I am getting unabl...
by erondem
Tue Feb 26, 2019 11:41 am
Forum: Beginners
Topic: How to manage with background scheduled tasks
Replies: 0
Views: 166

How to manage with background scheduled tasks

I have a python program running on RP3 B+. Raspberry has a NRF24L01, TSL2561 and YF S201 water flow sensor. Program flow should be as follows: in main loop raspberry always should listen NRF channel , when there is data, some work is done in the data and sent to Azure. as background tasks, a) TSL256...
by erondem
Fri Dec 21, 2018 4:57 pm
Forum: Advanced users
Topic: How to get Raspberry's IP adress with c++ Code
Replies: 7
Views: 2592

Re: How to get Raspberry's IP adress with c++ Code

Hi, My raspbery pi is doing regular tasks and send logs to the server. The network which server is running on has DHCP enabled. So sometimes IP of the raspberry can change (I thing IT guys, changes something on the network, and the IP which is assigned to raspberry is changes). When I need to chang...
by erondem
Fri Dec 21, 2018 12:54 pm
Forum: Advanced users
Topic: How to get Raspberry's IP adress with c++ Code
Replies: 7
Views: 2592

Re: How to get Raspberry's IP adress with c++ Code

The usual and easy way to do this is to use system() or popen() to get the info from running one of the usual utilities (ipconfig, ip, etc). This should qualify as "doing it in C/C++". However, people often want to do it directly in their chosen programming language. This can, of course, be done, b...
by erondem
Fri Dec 21, 2018 12:09 pm
Forum: Advanced users
Topic: How to get Raspberry's IP adress with c++ Code
Replies: 7
Views: 2592

How to get Raspberry's IP adress with c++ Code

Hi, My raspbery pi is doing regular tasks and send logs to the server. The network which server is running on has DHCP enabled. So sometimes IP of the raspberry can change (I thing IT guys, changes something on the network, and the IP which is assigned to raspberry is changes). When I need to change...
by erondem
Wed Dec 12, 2018 11:12 am
Forum: C/C++
Topic: How to detect if a program is running via c++ code
Replies: 11
Views: 2860

Re: How to detect if a program is running via c++ code

ps -ef | grep programname | wc -l This bash command lists all running processes, find all lines with "programname" and count the lines.. if this return 1 or more, your program is running. So one way of solving this is to run this command with system() or popen() and get the result. Another way is t...
by erondem
Wed Dec 12, 2018 8:02 am
Forum: C/C++
Topic: How to detect if a program is running via c++ code
Replies: 11
Views: 2860

How to detect if a program is running via c++ code

Hi I want to blink 3 Led according to these criterias 1. Blink if there is internet connection 2. Blink if raspberry is powered up 3. Blink if a program is running I have a program which is written in C++. I can do it first and second , but I need advice/help on third one. Does anyone know how to do...
by erondem
Thu Nov 29, 2018 11:49 am
Forum: Beginners
Topic: Re start a program after it crashes
Replies: 4
Views: 406

Re: Re start a program after it crashes

yes use a wrapper script not tested :- #!/bin/bash while : do program.exe done then run that script instead of your program or write your code better N.B. why call it .exe - thats not the linux / unix way But how does tihs script understand if program.p(lets call it .p instead of .exe thanks for th...
by erondem
Thu Nov 29, 2018 11:36 am
Forum: Beginners
Topic: Re start a program after it crashes
Replies: 4
Views: 406

Re start a program after it crashes

In my pi there is a progam written by me and it crashes if internet goes for long time. I need to re login via ssh and start again the program. What I need is when program.exe stopped working it needs to be re-started. I added both below lines to one by one to ~/.config/lxsession/LXDE-pi/autostart b...
by erondem
Mon Oct 01, 2018 11:46 am
Forum: Beginners
Topic: How to shut down a program ?
Replies: 7
Views: 571

Re: How to shut down a program ?

topguy wrote:
Mon Oct 01, 2018 11:37 am

Code: Select all

rgrep "name" /etc/systemd
This would be a quick way to see if there are any installed services for the program.
Can this somehow be related with "avahi"? When I entered ps -eaf I see there :

avahi-daemon: running [NAMEOFMYPROGRAM.local]
by erondem
Mon Oct 01, 2018 11:28 am
Forum: Beginners
Topic: How to shut down a program ?
Replies: 7
Views: 571

Re: How to shut down a program ?

depends on the program , but if this is started via systemd look at the service file as it may have options set for restart what is this program , where has it come from why do you want to stop it It is a C program which sends sensor data to a server. I made some changes, since I couldnt shut the f...
by erondem
Mon Oct 01, 2018 11:13 am
Forum: Beginners
Topic: How to shut down a program ?
Replies: 7
Views: 571

How to shut down a program ?

Hi, In my raspberry, there is a program running at startup and when I try to kill with command sudo kill -9 PIDNUMBER the program just restarts itself again. Program has written before but not by me. I looked for methods to start a program at boot and check them but none of them helped me. (https://...
by erondem
Sat Aug 11, 2018 8:29 pm
Forum: Beginners
Topic: Executing a .o file at reboot
Replies: 13
Views: 1626

Re: Executing a .o file at reboot

@reboot DISPLAY:0 cd /usr/local/bin/cpp && ./test Three things wrong with that. 1. If you have a graphical program start it from the LXDE auto start. Also it's DISPLAY = :0. 2. In crontab don't use cd. Run the program from the full path. 3. Is your code really in /usr/local/bin/cpp? It's more usual...
by erondem
Thu Aug 09, 2018 11:14 am
Forum: Beginners
Topic: Executing a .o file at reboot
Replies: 13
Views: 1626

Re: Executing a .o file at reboot

I compile my code with this line and I am sure it is executable g++ main.cpp -lwiringPi -lpthread -lcurl -o test And again it works perfect when I go to that directory and and execute with ./test And my crontab task is like this: Still nothing appears after boot. What I expect is to see the terminal...
by erondem
Fri Aug 03, 2018 1:12 pm
Forum: Beginners
Topic: Executing a .o file at reboot
Replies: 13
Views: 1626

Re: Executing a .o file at reboot

The first is that when running under cron, you don't have the full enviroment you get when running in a login shell. The big thing that is missing is the PATH variable. So where should i add PATH variable? to my crontab command ? And I read some pages which says adding PATH might lead to security p...
by erondem
Thu Aug 02, 2018 3:29 pm
Forum: Beginners
Topic: Executing a .o file at reboot
Replies: 13
Views: 1626

Re: Executing a .o file at reboot

Lets start with this line @reboot cd home/pi/Desktop/passdev/src/cpp && ./out.o 1. You are missing a / before home. Should be /home/pi/Desktop etc. 2. Why not just call "/home/pi/Desktop/passdev/src/cpp/out.o I'm sure someone with more C/C++ experience will come along and give you some advice about...
by erondem
Thu Aug 02, 2018 2:48 pm
Forum: Beginners
Topic: Executing a .o file at reboot
Replies: 13
Views: 1626

Executing a .o file at reboot

Hi all, I have a c++ code which has an output of out.o file. Firstly every time I go to direction where the file is which is cd home/pi/Desktop/passdev/src/cpp and afterwards type ./out.o My code works only in this way without any problem. Also the program connects to the internet. I think that migh...
by erondem
Wed Aug 01, 2018 1:10 pm
Forum: Advanced users
Topic: Getting data from html from and writing to a .txt file
Replies: 1
Views: 426

Re: Getting data from html from and writing to a .txt file

In short this is a question of how to get some credientals from a web form and how to write it to a .txt file. I think second part is okey but first part where I stucked
by erondem
Wed Aug 01, 2018 12:27 pm
Forum: Advanced users
Topic: Getting data from html from and writing to a .txt file
Replies: 1
Views: 426

Getting data from html from and writing to a .txt file

Hi, I have a html form and it form is loaded with initial values of config.txt in the raspberry. Till now everything is okey. But when I want to change the content of config.txt using the html form in the local server config.txt gets empty. I am using this library: https://github.com/yhirose/cpp-htt...
by erondem
Wed Aug 01, 2018 6:54 am
Forum: Advanced users
Topic: OTA Software update of a c++ program in a RP3
Replies: 3
Views: 721

Re: OTA Software update of a c++ program in a RP3

can Raspberry look into a git repository or some sort of server and if there is change in the version download and run new software? [ ... ] Can someone suggest me something? Resin.IO ? https://resin.io I think resin.io is not free service :/ Git is not a bad idea.. You need to install a script on ...
by erondem
Wed Jul 25, 2018 7:46 am
Forum: Advanced users
Topic: OTA Software update of a c++ program in a RP3
Replies: 3
Views: 721

OTA Software update of a c++ program in a RP3

Hi all, I have a running program inside my raspberry and it is running on the field. When I add a new feature to the program or need to fix a bug or change something in the software what I do is going to the near raspberry because I am not able to access its network for some reasons. Instead of doin...

Go to advanced search