Go to advanced search

by syscharger
Thu Sep 08, 2016 4:22 am
Forum: General discussion
Topic: syntax representation (Unterminated quoted string)
Replies: 4
Views: 1616

Re: syntax representation (Unterminated quoted string)

Thanks CarlRJ and hk1963 for your help.
All GOOD !!
by syscharger
Tue Sep 06, 2016 10:20 am
Forum: General discussion
Topic: syntax representation (Unterminated quoted string)
Replies: 4
Views: 1616

syntax representation (Unterminated quoted string)

appreciate if some expert can teach me how to represent a sudo command into a python script. from this (No error) sudo iwlist wlan0 scan | grep -i essid | awk -F\" '{ print $2 }' >> essid.txt to this (ERROR!!) os.system(“sudo iwlist wlan0 scan | grep -i essid | awk -F\" '{ print $2 }' >> essid.txt”)...
by syscharger
Mon Aug 29, 2016 9:11 am
Forum: General discussion
Topic: wifi - switch between different hotspot
Replies: 10
Views: 2319

Re: wifi - switch between different hotspot

It shows up like this in ps -ef | grep supplicant root 1898 1 0 Aug25 ? 00:00:03 /sbin/wpa_supplicant -s -B -P /run/wpa_supplicant.wlan0.pid -i wlan0 -D nl80211,wext -c /etc/wpa_supplicant/wpa supplicant.conf Thanks for the reply. I manage to Kill (sudo kill PID). But could not get it to restart us...
by syscharger
Mon Aug 29, 2016 8:25 am
Forum: General discussion
Topic: wifi - switch between different hotspot
Replies: 10
Views: 2319

Re: wifi - switch between different hotspot

Just what I thought. No one has a clue. You probably want it to connect to different access points as easily as you can on your phone, tablet, or laptop. I already given up. If you create more than one /etc/wpa_supplicant/wpa_supplicant.conf file (different names obviously) then you could restart w...
by syscharger
Fri Aug 26, 2016 1:20 pm
Forum: General discussion
Topic: wifi - switch between different hotspot
Replies: 10
Views: 2319

Re: wifi - switch between different hotspot

Thanks for the reply solar3000.
Does it mean its possible to modify this dhcpcd.conf thru python script?
by syscharger
Fri Aug 26, 2016 8:48 am
Forum: General discussion
Topic: wifi - switch between different hotspot
Replies: 10
Views: 2319

wifi - switch between different hotspot

Is it possible to programmatically, python code, switch between different nearby hotspots/accesspoints?
(assuming we know the SSID and network key)
Please advise. Many Thanks.
by syscharger
Mon Jul 18, 2016 7:44 am
Forum: General discussion
Topic: How to setup Raspberry Pi 3 Bluetooth Serial Port
Replies: 12
Views: 12780

Re: How to setup Raspberry Pi 3 Bluetooth Serial Port

Massi wrote:it can.
it has been discussed widely on the forum.
Search the forum..
for sure you'll have to start from a sudo bluetoothctl
sigh. tks. been trying and testing for the past few days. just couldnt get it to work. forummers seems to have a bluetooth adapter attached.
by syscharger
Mon Jul 18, 2016 6:02 am
Forum: General discussion
Topic: How to setup Raspberry Pi 3 Bluetooth Serial Port
Replies: 12
Views: 12780

How to setup Raspberry Pi 3 Bluetooth Serial Port

Hi, appreciate if any of you can advise. I am using the latest Jessie May 2016 firmware and Pi3. Would like to establish a connection with a Bluetooth Android phone. Tried the following, but not successful. AM i missing anything? xx:yy:zz:59:09:FF is the Bluetooth MAC of the Android Phone 1) sudo ap...
by syscharger
Fri Mar 04, 2016 9:36 am
Forum: General discussion
Topic: Making Calls using Linphone
Replies: 0
Views: 990

Making Calls using Linphone

i am not familiar with SIP phones. Any idea how to Make a call using the Linphone example? https://wiki.linphone.org/wiki/index.php/Raspberrypi:start example shows waiting for a call.. def main(): cam = SecurityCamera(username='raspberry', password='pi', whitelist=['sip:trusteduser@sip.linphone.org'...
by syscharger
Thu Jan 14, 2016 2:07 am
Forum: General discussion
Topic: Problem sending SMTP Email
Replies: 6
Views: 923

Re: Problem sending SMTP Email

Thanks for the replies.... GMAIL_USER was a typo on my side when i did a copy and paste. The intention was to send 1 email, but unfortunately the success rate is very low, hence i decided to send a succession of 10 emails to see the outcome. In most cases, i only manage to send 2-3 emails out of 10....
by syscharger
Wed Jan 13, 2016 10:04 am
Forum: General discussion
Topic: Problem sending SMTP Email
Replies: 6
Views: 923

Problem sending SMTP Email

i have been trying to send email using these codes. but will receive the following error code occasionally: [Errno -5] No address associated with hostname Any idea why? My success rate of sending this email is probably 0-20%. Is there a socket or timeout error? or?? Please advise. Many Thanks. #!/us...
by syscharger
Mon Dec 28, 2015 4:18 am
Forum: General discussion
Topic: Restart python script from crontab when it crash or killed
Replies: 11
Views: 5532

Re: Restart python script from crontab when it crash or kill

Is there alternative solution? If not using crontab.
Thanks
by syscharger
Mon Dec 28, 2015 1:57 am
Forum: General discussion
Topic: Restart python script from crontab when it crash or killed
Replies: 11
Views: 5532

Re: Restart python script from crontab when it crash or kill

SonOfAMotherlessGoat wrote:Is the account this cron job runs under able to sudo without a password?
Yes. able to.
i tried similar code below, no problem.

*/5 * * * * sudo python /home/pi/testpython.py
by syscharger
Mon Dec 28, 2015 1:39 am
Forum: General discussion
Topic: Restart python script from crontab when it crash or killed
Replies: 11
Views: 5532

Restart python script from crontab when it crash or killed

Added the following in crontab (sudo crontab -e) to check for running of python script (testpython.py) every 5 minutes If script not running, execute the script (testpython.py).. But unfortunately, it does not work. Any idea why? Did i miss something. Please advise. Thanks */5 * * * * pgrep -f testp...
by syscharger
Tue Sep 01, 2015 5:20 am
Forum: General discussion
Topic: Solving Eth0 and Wlan0 active/passive the right way
Replies: 8
Views: 2451

Re: Solving Eth0 and Wlan0 active/passive the right way

Can i do this, if i want to have wlan0 as my primary /priority interface whenever it is available, and eth1 and my secondary interface? case "$2" in up) /sbin/ifup $1 if [ "$1" = wlan0 ]; then /sbin/ifdown eth1 ; fi # To bring the ETH1 down ;; down) /sbin/ifdown $1 if [ "$1" = wlan0 ]; then /sbin/if...
by syscharger
Mon Aug 31, 2015 11:46 pm
Forum: General discussion
Topic: Solving Eth0 and Wlan0 active/passive the right way
Replies: 8
Views: 2451

Re: Solving Eth0 and Wlan0 active/passive the right way

Great. Thanks

btw.. in order for me to execute the code, i do the following?
$sudo bash -x ifupdown eth0 up
by syscharger
Mon Aug 31, 2015 12:36 pm
Forum: General discussion
Topic: Solving Eth0 and Wlan0 active/passive the right way
Replies: 8
Views: 2451

Re: Solving Eth0 and Wlan0 active/passive the right way

Thanks..
How do u interpret the following base on the code above?

Code: Select all

case "$2" in
up)
by syscharger
Mon Aug 31, 2015 9:54 am
Forum: General discussion
Topic: Solving Eth0 and Wlan0 active/passive the right way
Replies: 8
Views: 2451

Re: Solving Eth0 and Wlan0 active/passive the right way

Hi. i am very new to this bash script. May i know what is the significant of the "$2" and "$1" below? What does it represent? Thanks #!/bin/sh set -e case "$2" in up) /sbin/ifup "$1" if [ "$1" = eth0 ]; then /sbin/ifdown wlan0 ; fi # To bring the WLAN down ;; down) /sbin/ifdown "$1" if [ "$1" = eth0...
by syscharger
Wed Aug 26, 2015 8:57 am
Forum: General discussion
Topic: network adapter / interface priority setting
Replies: 0
Views: 552

network adapter / interface priority setting

my apology, a newbie in RPI... Is it possible to switch between 2 or more network adapter or interfaces? for example: if 2 connections are available (eth1 and wlan0), how can i set the priority to be on wlan0 whenever it is connected to an access point? and How to display the default Interface with ...

Go to advanced search