Recreate ssd

Posted on
Mon Apr 22, 2019 2:47 am
siclark offline
Posts: 1960
Joined: Jun 13, 2017
Location: UK

Recreate ssd

Hi.
I think I need to recreate the SSD on one of my pis. Is there anything I need to do to the plugin before or after I create the new ssd image and boot the pi with that?

Thanks.


Sent from my iPhone using Tapatalk

Posted on
Mon Apr 22, 2019 6:34 am
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Recreate ssd

After you start the rpi you need to
“Send all files to the rpi”
In the menu. That will update all programs to the latest version

Karl


Sent from my iPhone using Tapatalk

Posted on
Wed May 08, 2019 1:45 pm
siclark offline
Posts: 1960
Joined: Jun 13, 2017
Location: UK

Re: Recreate ssd

Hi Karl,

I am struggling getting the pi to reconnect.
I have it setup with a new clean install of Stretch.
I clicked send all files and it appears to have done that. However its now in a look creating a master.zip file every few minutes, incrementally numbering them master.zip.1, master.zip.2 etc. Whats gone wrong?

The state of the device shows as IPConnection and BLE down

I have edited the /etc/rc.local line.

Thanks

Simon

Posted on
Wed May 08, 2019 2:02 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Recreate ssd

do you use the posted SSD or a download from the RPI site?

and regarding the master.zip .. on the RPI? no clue how that can happen.

could you do:
start terminal
ssh pi@ ..
ps -ef | grep .py

post rc.local
post /home/pi/callbeacon.py
should look like:
callbeacon.py
Code: Select all
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import time

#set GPIOs if requested BEFOR master.py runs just onece after boot
os.system("/usr/bin/python /home/pi/pibeacon/doGPIOatStartup.py & ")


# make new directories if they do not exist
os.system("mkdir /home/pi/pibeacon/> /dev/null 2>&1 ")
os.system("mkdir /home/pi/pibeacon/soundfiles> /dev/null 2>&1 ")
os.system("mkdir /home/pi/pibeacon/fonts> /dev/null 2>&1 ")
os.system("mkdir /home/pi/pibeacon/displayfiles> /dev/null 2>&1 ")
os.system("mkdir /home/pi/pibeacon/temp> /dev/null 2>&1 ")
## set permissions
os.system("chmod +666 -R /home/pi/pibeacon> /dev/null 2>&1 ")
os.system("chmod +111 -R /home/pi/pibeacon/*.py> /dev/null 2>&1 ")

os.system("chmod +777 -R /home/pi/pibeacon/soundfiles> /dev/null 2>&1 ")
os.system("chmod +777 -R /home/pi/pibeacon/fonts> /dev/null 2>&1 ")
os.system("chmod +777 -R /home/pi/pibeacon/displayfiles> /dev/null 2>&1 ")
os.system("chmod +777 -R /home/pi/pibeacon/fonts> /dev/null 2>&1 ")
os.system("chown -R  pi  /home/pi/pibeacon/ ")
os.system("rm  /home/pi/pibeacon/restartCount > /dev/null 2>&1 ")

os.system("rm  /home/pi/pibeacon/*.pyc> /dev/null 2>&1 ")

## call main program
os.system("sleep 10; cd /home/pi/pibeacon; python /home/pi/pibeacon/master.py &")

## clean up old files
os.system("rm  /home/pi/beaconloop.py> /dev/null 2>&1 ")
os.system("rm  /home/pi/BLEconnect.py> /dev/null 2>&1 ")
os.system("rm  /home/pi/batteryLevelPosition> /dev/null 2>&1 ")
...


cd pibeacon
post
ls -l *

post
cat parameters


Karl

Posted on
Wed May 08, 2019 2:18 pm
siclark offline
Posts: 1960
Joined: Jun 13, 2017
Location: UK

Re: Recreate ssd

Will do, but first, I had already tried manually running callbeacon.py manually, and this is the result. Looks like an issue getting an ipaddress? do I need to change the folder ownership manually with sudo first?



pi@pi-server:~ $ (python /home/pi/callbeacon.py &)
pi@pi-server:~ $ chown: changing ownership of '/home/pi/pibeacon/temp/networkMODE': Operation not permitted
mount: only root can use "--options" option
20190508-21:15:39 toLog master in Line '83' has error='[Errno 13] Permission denied: '/run/user/1000/pibeacon/master.log''
sh: 1: kill: Operation not permitted

20190508-21:15:40 toLog master in Line '83' has error='[Errno 13] Permission denied: '/run/user/1000/pibeacon/master.log''
sh: 1: kill: Operation not permitted

20190508-21:15:42 simplei2csensors did not find IP number
20190508-21:15:42 simplei2csensors getsensors no ip number exiting
sh: 1: kill: Operation not permitted

chmod: changing permissions of '/home/pi/pibeacon/piBeaconGlobals.pyc': Operation not permitted
chmod: changing permissions of '/home/pi/pibeacon/piBeaconUtils.pyc': Operation not permitted
chown: changing ownership of '/home/pi/pibeacon/piBeaconGlobals.pyc': Operation not permitted
chown: changing ownership of '/home/pi/pibeacon/piBeaconUtils.pyc': Operation not permitted
Master adhocWifi is: -1 ; G.wifiType is: normal
20190508-21:15:44 master IP find:::: wifiIP >><<; eth0IP: >><<; hostnameIP >>['192.168.0.46']<<; ipAddressRead >><<
20190508-21:15:44 master U.getIPNumberMaster bad IP number ... ipHostname >>['192.168.0.46']<< old from file ipAddressRead>><< not in sync with ifconfig output: wifi0IP>><<; eth0IP>>
pi@pi-server:~ $ 20190508-21:15:49 master IP find:::: wifiIP >><<; eth0IP: >><<; hostnameIP >>['192.168.0.46']<<; ipAddressRead >><<
pi@pi-server:~ $ 20190508-21:15:50 master U.getIPNumberMaster bad IP number ... ipHostname >>['192.168.0.46']<< old from file ipAddressRead>><< not in sync with ifconfig output: wifi0IP>><<; eth0IP>>
pi@pi-server:~ $ 20190508-21:15:55 master IP find:::: wifiIP >><<; eth0IP: >><<; hostnameIP >>['192.168.0.46']<<; ipAddressRead >><<
20190508-21:15:55 master U.getIPNumberMaster bad IP number ... ipHostname >>['192.168.0.46']<< old from file ipAddressRead>><< not in sync with ifconfig output: wifi0IP>><<; eth0IP>>
20190508-21:16:00 master IP find:::: wifiIP >><<; eth0IP: >><<; hostnameIP >>['192.168.0.46']<<; ipAddressRead >><<
20190508-21:16:00 master U.getIPNumberMaster bad IP number ... ipHostname >>['192.168.0.46']<< old from file ipAddressRead>><< not in sync with ifconfig output: wifi0IP>><<; eth0IP>>
20190508-21:16:05 master IP find:::: wifiIP >><<; eth0IP: >><<; hostnameIP >>['192.168.0.46']<<; ipAddressRead >><<
20190508-21:16:05 master U.getIPNumberMaster bad IP number ... ipHostname >>['192.168.0.46']<< old from file ipAddressRead>><< not in sync with ifconfig output: wifi0IP>><<; eth0IP>>
20190508-21:16:10 master IP find:::: wifiIP >><<; eth0IP: >><<; hostnameIP >>['192.168.0.46']<<; ipAddressRead >><<
20190508-21:16:10 master U.getIPNumberMaster bad IP number ... ipHostname >>['192.168.0.46']<< old from file ipAddressRead>><< not in sync with ifconfig output: wifi0IP>><<; eth0IP>>
20190508-21:16:15 master starting web server : port 80 for status
Traceback (most recent call last):
File "/home/pi/pibeacon/webserverSTATUS.py", line 63, in <module>
f=open( G.homeDir+"ipAddress","r")
IOError: [Errno 2] No such file or directory: '/home/pi/pibeacon/ipAddress'
20190508-21:16:15 installLibs starting
20190508-21:16:15 installLibs no opsys upgrade requested
test: [4.0, True, True, False, True, False, False, False, False, False]
20190508-21:16:26 toLog installLibs in Line '84' has error=''ascii' codec can't decode byte 0xe2 in position 693: ordinal not in range(128)'
DHTinstalled False
20190508-21:16:28 installLibs install finished
open: Permission denied
rm: cannot remove '/tmp/wiringPi': No such file or directory
20190508-21:16:29 master installing gpio wiringPi .... ('', '/bin/sh: 1: gpio: not found\n')
with: cd /tmp; git clone git://git.drogon.net/wiringPi; cd wiringPi; ./build ; rm -R /tmp/wiringPi
20190508-21:16:29 master result of installing gpio wiringPi .... ('', "/bin/sh: 1: git: not found\n/bin/sh: 1: cd: can't cd to wiringPi\n/bin/sh: 1: ./build: not found\nrm: cannot remove '/tmp/wiringPi': No such file or directory\n")
20190508-21:16:29 beaconloop did not find IP number
no ip number
20190508-21:16:30 master U.getIPNumberMaster bad IP number ... ipHostname >>['192.168.0.46']<< old from file ipAddressRead>><< not in sync with ifconfig output: wifi0IP>><<; eth0IP>>
20190508-21:16:30 master starting master loop
20190508-21:16:30 master starting web server : port 80 for status
Traceback (most recent call last):
File "/home/pi/pibeacon/webserverSTATUS.py", line 63, in <module>
f=open( G.homeDir+"ipAddress","r")
IOError: [Errno 2] No such file or directory: '/home/pi/pibeacon/ipAddress'
20190508-21:16:31 BLEconnect did not find IP number
no ip number
20190508-21:16:50 Wire18B20 did not find IP number
20190508-21:16:50 Wire18B20 getsensors no ip number exiting
20190508-21:16:50 simplei2csensors did not find IP number
20190508-21:16:50 simplei2csensors getsensors no ip number exiting
20190508-21:16:50 master starting web server : port 80 for status
Traceback (most recent call last):
File "/home/pi/pibeacon/webserverSTATUS.py", line 63, in <module>
f=open( G.homeDir+"ipAddress","r")
IOError: [Errno 2] No such file or directory: '/home/pi/pibeacon/ipAddress'
20190508-21:16:50 beaconloop did not find IP number
no ip number
20190508-21:16:51 BLEconnect did not find IP number
no ip number

Posted on
Wed May 08, 2019 2:37 pm
siclark offline
Posts: 1960
Joined: Jun 13, 2017
Location: UK

Re: Recreate ssd

.....................
Last edited by siclark on Wed May 08, 2019 3:05 pm, edited 1 time in total.

Posted on
Wed May 08, 2019 2:58 pm
siclark offline
Posts: 1960
Joined: Jun 13, 2017
Location: UK

Re: Recreate ssd

Appears to be an eth0 setup issue.

This is ip a output from impacted pi

Code: Select all
ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: enxb827eb987891: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether b8:27:eb:98:78:91 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.46/24 brd 192.168.0.255 scope global enxb827eb987891
       valid_lft forever preferred_lft forever
    inet6 fe80::9cde:5f51:9194:7a95/64 scope link
       valid_lft forever preferred_lft forever
3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
    link/ether b8:27:eb:cd:2d:c4 brd ff:ff:ff:ff:ff:ff


and from good pi

Code: Select all
ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether b8:27:eb:f4:bc:29 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.47/24 brd 192.168.0.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::4dc7:f74f:7d3d:889f/64 scope link
       valid_lft forever preferred_lft forever


The detail son the 2nd entry on the bad pi looks good, but why is it under enxb827eb987891 and not eth0?

Posted on
Wed May 08, 2019 3:06 pm
siclark offline
Posts: 1960
Joined: Jun 13, 2017
Location: UK

Re: Recreate ssd

Turns out was a simple fix and caused by me playing with config settings I didnt understand the impact of!



If you are on Raspbian then raspi-config is easiest method.

sudo raspi-config
Select "2. Network options"
Select "N3 Network interface names"
Select "No". It's now disabled predictable network interface names.
Click "OK" and "Finish". Then it will reboot your raspberry pi.

Posted on
Wed May 08, 2019 3:41 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Recreate ssd

Sudo python call beacon.py

When called from rc. local it’s root anyway



Sent from my iPhone using Tapatalk

Posted on
Wed May 08, 2019 3:42 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Recreate ssd

And ... I strongly suggest to download the pre config ssd


And then you can do sudo apt-get....

Much easier



Sent from my iPhone using Tapatalk

Posted on
Wed May 08, 2019 3:44 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Recreate ssd

And I just released a new version. Much better for log files. Does not mess around with .... /1000/pibeacon
...


Sent from my iPhone using Tapatalk

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 4 guests