Friday 12 June 2020

Raspios and Duplicating Raspberry Pi system

This one is in three parts. The Third part is resorting back to Raspbian Buster to try and get this working.

----------------------------

Ok, so I have not had any luck trying to do a diskcopy from one SD card to another, so I decided to just rebuild the system.

-----------------------------         PART 2
I Installed the latest Raspbian OS, now called Raspbios, onto uSD card #10, also a 16GB card and reinstalled all the software. For whatever reason the Wifi didn't work, so I am starting again.

1. Flashed Raspbios (May'20 version) onto card and set it up to enable ssh, and also downloaded the python/HTML files into it.

2. Boot on Ethernet in R-PI card B-rev2, and update and install the driver for the ZD1211 card, and then configure the network.  [ initial IP = 26]
sudo apt-get update
sudo apt-get install firmware-zd1211
Use raspi-config to set Ethernet to 192.168.1.9/24 and wireless to 192.168.1.8/24
- this doesn't work- it cannot find wireless (dongle was not plugged in) and I don't find where to configure Ethernet.

So: edit dhcpcd.conf and wpa_supplicant.conf to configure network and wireless using the usual settings

Note that I discovered that wpa_supplicant was set to the ISSID of the downstairs router, not the local one.

Having done this, reboot and see what IP address the Ethernet picks up. Typically use fing for this.
Result - both Ethernet (9) and Wireless(8) work.


3. Install Flask and configure and get it running on wireless.
sudo apt install python3-flask

Put the shell script in Home directory and also in RC.local

File go-car.sh contains:
      export FLASK_APP=/home/pi/rc-car/app.py
      flask run --host=192.168.1.8

Tried to run it: "No module called gpiozero" error.
Found gpiozero site https://pypi.org/project/gpiozero/
It says "pip install gpiozero"
But pip command not found. 
Installation instructions:
sudo apt install python3-gpiozero
try again:
Interesting error: 
* Serving Flask app "/home/pi/rc-car/app.py"
* Environment: production
  WARNING: Do not use the development server in a production environment.
  Use a production WSGI server instead.
*** basically I can ignore it.

4. Install Access point software.
At this point follow my previous post:
https://madsmaddad.blogspot.com/2020/02/raspberry-pi-ad-hoc-wireless.html

Found that the link within it to Raspberry Pi documentation on setting up an Access Point had disappeared.
 Used  this and edited dnsmasq.conf as suggested
https://www.raspberrypi.org/documentation/configuration/wireless/access-point-routed.md
Skipped the bit about Internet Routing.

Created /etc/hostapd/hostapd.conf containing
country_code=GB
interface=wlan0
ssid=rc-car
hw_mode=g             ??? Should be b? --> g is valid for zd1211
channel=7
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=Ashmeads
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

rebooted.

No wireless Lan found.
Think I'll have to edit to make hw_mode B

Changed hw_mode to b
changed channel to 4
comment out wpa_pairwise and rsn_pairwise because they were not used in normal operation.

Reboot with WiFi   -- no joy.

Check IP addresses, though this is not the problem.

Replaced Hostapd.conf with this from old version:
interface=wlan0
driver=nl80211
ssid=rc-car
hw_mode=g
channel=7
wmm_enabled=0
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=Ashmeads
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

Still didn't work. The difference that I noted that made me do this is the Driver line. 

-- -- Have stuck the question up on the Raspberry Pi Forums as  # 277183

Now edited to be:

country_code=GB            # added
interface=wlan0
driver=nl80211
ssid=rc-car
hw_mode=b                  # changed from g to b
channel=4                  # changed from 7 to 4
wmm_enabled=0
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=Ashmeads
wpa_key_mgmt=WPA-PSK
# wpa_pairwise=TKIP        #commented 
# rsn_pairwise=CCMP        #commented


No luck, and it looks like the Pi has crashed? No activity light action. Plugged in Ethernet, Life.

dmesg output: 

[   20.148077] usb 1-1.2: reset high-speed USB device number 4 using dwc_otg
[   20.608179] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[   20.609695] zd1211rw 1-1.2:1.0: phy0
[   20.613235] usbcore: registered new interface driver zd1211rw
[   24.315134] random: crng init done
[   24.315160] random: 7 urandom warning(s) missed due to ratelimiting
[   25.769531] 8021q: 802.1Q VLAN Support v1.8
[   26.877003] Adding 102396k swap on /var/swap.  Priority:-2 extents:1 across:102396k SSFS
[   26.922096] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
[   26.923339] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   27.007719] zd1211rw 1-1.2:1.0: firmware version 4725
[   27.051722] zd1211rw 1-1.2:1.0: zd1211b chip 0586:3410 v4810 high 00-19-cb AL2230_RF pa0 g--NS
[   27.105805] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[  261.167345] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[  261.180014] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
[  263.237497] ICMPv6: process `dhcpcd' is using deprecated sysctl (syscall) net.ipv6.neigh.eth0.r
etrans_time - use net.ipv6.neigh.eth0.retrans_time_ms instead



pi@raspberrypi:~ $ iwconfig
eth0      no wireless extensions.

lo        no wireless extensions.

wlan0     IEEE 802.11  ESSID:off/any
         Mode:Managed  Access Point: Not-Associated   Tx-Power=20 dBm
         Retry short limit:7   RTS thr:off   Fragment thr:off
         Power Management:off


Release notes for Raspberry Pi OS don't have anything useful. 

Tried Raspi-config to set Localisation settings (option 4) But it came back with could not communicate with wpa_supplicant



---------------------------        PART 3
Giving up on Raspberry Pi OS and going back to Raspbian Buster. If I get that working I might try a dist-upgrade on it.  So repeating the instructions as above. 

Flashing buster 2020-02-13 (looks like full system) into 16GB uSD card #10
setup ssh
edited dhcpcd.conf and wpa_supplicant.conf
added rc-car stuff

It should boot to ...9  and have updated ZD1211, and normal update on new installation procedure.
Install Flask and rc.local bit. 
This time I tried to get ahead so I tried 'pip install gpiozero' and the system responded that gpiozero is already the latest version.  OK. 

At this point reboot with wireless and check.   OK It works. 
I am connected via wireless (IP ...8) and I guess now have to install the AP stuff.

Followed instructions, and rebooted.   Wifi network not there, cannot connect.
----------------------------
Came across this:
https://github.com/raspberrypi/linux/issues/3671

It's not just my problem.

Interesting suggestions:
https://hawksites.newpaltz.edu/myerse/2018/06/08/hostapd-on-raspberry-pi
 -- This is an excellent article, even if dated 2018.


This one is out of date: ubuntu 14.04 refers
https://seravo.fi/2014/create-wireless-access-point-hostapd

Hostapd documentation, current april 2020
https://wiki.gentoo.org/wiki/Hostapd

another interesting link:
https://thepi.io/how-to-use-your-raspberry-pi-as-a-wireless-access-point/

--------------------
from this https://unix.stackexchange.com/questions/119209/hostapd-will-not-start-via-service-but-will-start-directly   I set /etc/default/hostapd line  to spell out the full file name of the hotapd config file
DAEMON_CONF="/etc/hostapd/hostapd.conf"

This is because of lines in syslog about config file not found
"Jun 18 19:44:00 raspberrypi systemd[1]: Stopped Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator.
Jun 18 19:44:00 raspberrypi systemd[1]: Starting Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator...
Jun 18 19:44:00 raspberrypi hostapd[15736]: Configuration file:
Jun 18 19:44:00 raspberrypi hostapd[15736]: Could not open configuration file '' for reading.
Jun 18 19:44:00 raspberrypi hostapd[15736]: Failed to set up interface with
Jun 18 19:44:00 raspberrypi hostapd[15736]: Failed to initialize interface
Jun 18 19:44:00 raspberrypi systemd[1]: hostapd.service: Control process exited, code=exited status=1
Jun 18 19:44:00 raspberrypi systemd[1]: Failed to start Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator.
Jun 18 19:44:00 raspberrypi systemd[1]: hostapd.service: Unit entered failed state.             
Jun 18 19:44:00 raspberrypi systemd[1]: hostapd.service: Failed with result 'exit-code'.

Brilliant, It is There!














Tuesday 2 June 2020

Thoughts on Business and Management (before 2011)

obviously written before retirement as I wasn't attending meetings any more.
--------------------------
I really shouldn't be allowed time to think.


On my way to the meeting today I was questioning in my mind whether we were a Business School or a Management School, forgetting of course that we are the Management group in The Business School.


I contemplated what each was: What is Business?/What is management?, and  came to the conclusion that in order to do management you needed something to manage, - a Business.


Then what does a Business do? It supplies something, whether it be a product, a service, a process, or a skill. (and other things?)


It needs to:
- Create  the product or service
- Market it
- Supply it to customers
- do it legally. And legislation is always changing.

Each type of these requires management, and the forms(?) of management may vary.  The functions of management that are required, based on the specialities available in the Business School, and thoughts that came out of the meeting today, are:

Bean counters (  Accounting and Finance) {- already a group}
Legal people   (Law) {-already a group}

- Strategy


- HRM


- Direction of the business (day-to-day management/decision making)


- Production management ( Not taught in the Business School)


- Project Management


- Data Management?


- Marketing


- Disaster Management ( Hopefully pre-emptive)


- ??

And all of these require, in different forms and amounts BI (business Intelligence) which comes out of or is parallel to KM (Knowledge Management), which comes out of Information Systems.  ( Is this where data management is?)


Therefore, as Dean Brady said, IS should be embedded in every aspect of the teaching in the Business School.


At one point my differentiator between the BS and DEC was that in DEC they were taught the in-depth stuff of Networking and Communications (and Software) so that they could design the next generations of the stuff, whereas in the Business School students were taught how to use it and put it together in order to optimize its use in the Business World, and overcome 'the productivity paradox' (Goldman 2003). Nowadays I think that this has changed. The networks are there in the Business and techies exist to look after them. We must concentrate more on the 'Information' in IS, and the optimization of that.