Monday 27 November 2017

RC-Car-5 Control from Instructables

This looks like a good solution because it just uses common applications and is not someones proprietary do it all app. I did like the idea of the Scratch like interface in Wyliodrin, but am quite happy to write code when I can see what I am doing.

[ Chrome crashed and I now have to try and replicate what I had said]

This is what I am going to try and do: http://www.instructables.com/id/IoT-Controlling-a-Raspberry-Pi-Robot-Over-Internet/

It's  using basic apps and should be quite versatile.

It is version #6 for me.
I am using SD card #1 and have started with Raspbian stretch, loaded the network wireless interface configurations that I use and the empty ssh file in the root directory.

Connected via ssh and
sudo raspi-config to expand file space
sudo apt-get update

Then needed 'git' so sudo apt-get install git.

From the instructables installed wiringPi:
git clone git://git.drogon.net/wiringPi
cd wiringPi
./build
Now to figure out how to initialise the output pins at startup. The pins that I have used before are:

FORWARD = 17       # GPIO pin using BCM numbering
BACKWARD = 23
STOPPIT = 25
LEFT = 10
RIGHT = 11

just to test I did:
pi@raspberrypi:~ $ gpio -g mode 10 out
pi@raspberrypi:~ $ gpio -g write 10 1
pi@raspberrypi:~ $
pi@raspberrypi:~ $ gpio -g write 10 0
pi@raspberrypi:~ $

which worked. 
My script will be a bit simpler than the example because forward/reverse are a mating pair and left/right are also.

Script 'forward' will be:
#!/bin/bash
gpio -g write 17 1
gpio -g write 23 0

and 'stop' will reset everything
#!/bin/bash
gpio -g write 10 0
gpio -g write 11 0
gpio -g write 17 0
gpio -g write 23 0
these scripts go into /var/www/cgi-bin and get set to  chmod 755

wrote initialisation commands into /etc/rc.local
gpio -g mode 10 out
gpio -g mode 11 out
gpio -g mode 17 out
gpio -g mode 23 out

that's completed step 3.
Jump to step 5.   Installing the web server.
done, and also step 6 started, Have copied html to PC and now need to edit it and find button images to store on RPi.

[2017-11-28]  Going to nick button images from one of the early attempts and use them.

No I'm not. They are gone.

Downloaded an arrow png and saved three more copies of it rotated 90 deg each time. Also a red Stop cross.  Ftp'd down to var/www/images
Moved index.html to /var/www.
stopped and started lighttpd. but when I browse to it, it displays the html code?
Chmod 755 the index.html, but still no success.
Commented out the commands and it works using the script from the writeup. Now need to take out some bits and move on. 

Then to try it on the car and not just on the test breadboard.



Note: one problem that I know that I am going to have is doing turns. On the previous WebIOPi version I initially touched teh button a second time to stop the action, then modified the program to only turn for 300ms then switch off the turn and return to centre.  Need to figure out whether I can do this in the bash scripts here.

[2017/11/30]
In one of the WiringPi blogs I noticed that I have to initialise the GPIO for pwm using this string "export WIRINGPI_GPIOMEM=1" so I did, but no effect.

WiringPi at: http://wiringpi.com/


[2017/12/01]
Just rewired the test rig so that reverse (on pin 23) now on GPIO18 /wiringPi 1, Pin 12 and tested with the scripts in the article. That works because it is the hardware pwm pin.
To make it work on the car I am going to have to rewire the forward pin (17) to this location. If I wanted to do it for both forward and reverse I would need a NAND gate on each. One input to select the direction and one to select the speed/pwm.

Also I would have to figure out where to initialise the pwm pin. can I do it in the rc.local initialisation, or run a script from the html at startup.

[2017-12-02]
Changing the pin for the Forward motion also requires going back to the other working version (WebIOPi) and changing that so that both programs are compatible with the same hardware without changes. I'll do it though just so that I can play with pwm.

In WebIOPi I have to change all three files- Config, Index.html, and script.py
This works ok in car. I must make the changes to the file on the PC to keep in step.

BUT the Instructables version only works for Left/right., not forward and backwards, and I have just realised why. I didn't initialise in rc.local the pin 18.
Done that, but not working. More thinking required.

[2017-12-03] Rewired test rig of LEDs to tidy up.
Tested with WebIOPi system to check it still all works, with forward on pin GPIO 18

Instructables version - Forward works, reverse doesn't and pwm controls do not.
Note this one is now on IP ...9. It means I don't have to reset the SSH security every time I log in to a different system.

In the regularspeed.cgi script I set the pin 23 to 0 before the pwm statement. - No effect.

[2017-12-04] Just a thought that pin 18 cannot have dual modes of operation. Can only be logic0/1 or pwm. This gives a problem when going in reverse, as I am not sure how to set it to a zero state. Acknowledging that if I keep pin 18 as pwm, then going in reverse will have the opposite effect, i.e full speed will = nospeed and vice versa.

worth a play, I'll edit the forward and backwards.cgi scripts.

rc.local:
gpio -g mode 10 out gpio -g mode 11 out gpio -g mode 18 pwm gpio -g mode 23 out

I think that I have to accept that Reverse doesn't work, when pwm on pin 18 and pin 23 is set high.

Tested on the car, and the motor only seems to have one speed in forward. Reverse still doesn't work. I think that the relays do not react fast enough to be able to support pwm.

A discussion with friends at the Dorset LUG made me realise that pin 18 (pwm) is only a source, not a sink, so obviously the motor would not go in reverse. Also they confirmed that I cannot drive relays with pwm, If I want that to work I should swap,out the relays for thyristors.

End of story until I find another IoT program to try!


[2018-02-08] Unfortunately something has disturbed the circuitry on the car, and now the steering doesn't work. I have decided to retire it until I get another car from the tip. Might be awhile.




















































Saturday 18 November 2017

RC-Car-4 WebIOPi is Obsolete. Long live ??

WebIOPi does not work with the latest version (stretch) of Raspbian.                            [2017-11-18]

My current state of memory cards is:
#1 SD card  not known
#2 SD card  Raspbian Jessie with WebIOPi not working
#3 uSD card WebIOPi working  - DO NOT TOUCH!
#4 uSD card WebIOPi working  - DO NOT TOUCH!  in RC-Car

#5 according to my records, is Forth, but I can't find it.

The Raspberry Pi that I am using for test purposes is a Model B rev 1, that accepts SD cards. If I want to do anything on my Raspberry Pi zero I am going to need some more uSD cards.

Cayenne is only supported on Raspbian wheezy according to the forums. And someone else on the Raspberry pi forums commented that it required cloud access, which is not something we want.

Blynk  As from previous post, does not work on my Raspberry Pi model B rev 1.

so what is next?

OOOh! Look what I found:
https://kaazing.com/remote-controlling-a-car-over-the-web-ingredients-smartphone-websocket-and-raspberry-pi/

Let's give it a try.  No. The detail isn't there, and it needs a Web-socket server 3rd piece of kit.

Next:


https://www.hackster.io/user16288277/diy-smart-iot-control-panel-raspberry-pi-zero-w-6d7264

This one uses a Mosquitto MSQT Message broker. May be smarter than I need.



Going to try the last one. 

Flashed the SD card #1 

Edited interfaces file to set static IP for wireless
Interfaces file refers to /etc/wyliodrin/wireless.conf, but no information is given about how to set this up. I could change back to wpa_supplicant, or wait for a response from wyliodrin.

Added ssh file in boot.
Added new project to Bookmarks bar.

[2017-11-23] Wyliodrin responded, said to put json file in the root of the FAT of the SD card. I have done this with no effect. I have loaded up Wyliodrin Studio and am trying to connect via Ethernet, but nothing is happening. It is, but it wants a username and password, neither of which are setup on the pi.
 Blank   blank doesn't work
blank   raspberry doesn't work
root    raspberry   doesn't work
peter.merchant_peter_merchant@wyliodrin.com  doguxokefu   doesn't work - from json file.

pi    raspberry is the correct set as per the default for the R-pi. (STUPID!)

[2017-11-26]   It didn't work, it wanted to update and hung. Wyliodrin suggested I use a later version linked to from Wyliodrin Studio, so I downloaded version 2017_08_25. This fired up, W-Studio connected to it, then said it couldn't find Wyliodrin and did I want to download it, which failed. I am not impressed so far.

I am going to prepare SD card #2, and see if that works.
Answer: No. Wyliodrin Studio tells me that Wyliodrin is not installed on the Pi that it is connected to.

I may wait and try this again sometime. Meanwhile on to the first one (Instructables) tomorrow.





Thursday 9 November 2017

RC-Car-3 The fun is in the making, not the using.

I have always wanted to play with RC vehicles, but never wanted to spend the money on the finished product, thinking that I would be bored with it in five minutes.

The Raspberry Pi gives everybody the opportunity to build things, and I decided to build an RC car for starters, but again, I thought that buying the appropriate parts and putting them together would take a lot of the fun out of it, so I decided to see what I could do with the R-Pi and a defunct RC car that I picked up at the tip. This story is told  in my blog: http://madsmaddad.blogspot.co.uk/2016/04/raspberry-pi-to-drive-ex-rc-car.html

I keep on looking at what has been done by others, but I am not going to just follow their instructions.  A quick google:
http://www.instructables.com/id/Raspberry-Pi-Smartphone-Controlled-Rc-Car/  - Looks like I might have to learn some Javascript, and I don't want to.

https://www.raspberrypi.org/magpi/rc-car-raspberry-pi/   Not enough instructions, but sounds good.

https://www.raspberrypi.org/blog/self-driving-car/          Wow. Something to aspire to.

Now I have updated the OS to Raspbian Stretch, and WebIOPi doens't work any more. There are workarounds on the net, but it is obvious that WebIOPi is not being supported or developed any more. One of the comments in the forum recommends Blynk http://www.blynk.cc/ and at the top of the WebIOPi page there is an later generation of the program called Cayenne.

I will test each of these and see if their features  are any good.  My base Raspbian will be Stretch.


Cayenne:   I will try it on SD card #1. It is available at https://mydevices.com/

Looked like it was working smoothly, but:
Fri 10 Nov 16:36:10 UTC 2017 Installing myDevices agent
0
Fri 10 Nov 16:39:20 UTC 2017 Found Python 3.5.3...
(50%)
Fri 10 Nov 16:39:20 UTC 2017 Copying agent libraries
(55%)
Fri 10 Nov 16:39:30 UTC 2017 Installing python utils
(60%)
Fri 10 Nov 16:40:41 UTC 2017 Installing software components
Fri 10 Nov 16:40:42 UTC 2017 Cannot install for Python 3.5.3 : missing development headers\n
Fri 10 Nov 16:40:42 UTC 2017 Finished agent code
Fri 10 Nov 16:40:42 UTC 2017 ERROR: myDevices cannot be installed - please check errors above

Oops, I forgot to do all the usual things with a new installation of Raspbian. Will do an update and upgrade and then try it again.

Error reports on Cayenne forums suggest that Wheezy is the only version of Raspbian supported.

Le't move on to Blynk

Blynk  Looks like the support for the Raspberry Pi is an afterthought, and also needs a Blynk Server. It is available at http://www.blynk.cc/
Needs special  software on the  Android/Apple  controller.  I will try it on SD card #2

The documentation looks like it steps you through the startup process very clearly, but soon comes to a dead stop. I have my Raspberry Pi [Stretch] fired up and prepared, the App installed on my Tablet [Android] and logged in, and I am following the instructions on my PC. The instructions are to download, unzip and install the libraries in my Arduino IDE, wherever that is.

Also I have to use an Authorisation token that Blynk have sent me, that is in my email inbox on my PC. I suspect that it is needed on my tablet, but am not sure.

Eventually I find a section in the docs on preparing the Raspberry Pi. I noticed it in the Table of Contents on the left hand side of the screen.  It seems straightforward and as I am ssh'd into the Raspberry Pi I can easily copy and paste the Authorisation code into the Pi.

No, This does not work either. The first instruction that I paste into the Raspberry Pi gives the following error message:
curl -sL "https://deb.nodesource.com/setup_6.x" | sudo -E bash -

## You appear to be running on ARMv6 hardware. Unfortunately this is not currently supported by the NodeSource Linux distributions. Please use the 'linux-armv6l' binary tarballs available directly from nodejs.org for Node.js v4 and later.


I'll try to resolve it, but if this first command causes this sort of problem, what will the others do.


Can't fix this. At Node.js, I tried to download the armv6 for ARM and the response was '404 - file not found' 


May have to follow these instructions: 

https://raspberrypi.stackexchange.com/questions/48303/install-nodejs-for-all-raspberry-pi

Note that the Raspberry Pi being used is a Model B Rev. 1.


From a suggestion on that web page I went to where a number of scripts to install node.js had been created and used https://github.com/sdesalas/node-pi-zero/blob/master/install-node-v6.11.3.sh


I connected to my Raspberry Pi using ssh, then opened a new file with nano, and copied the contents of this script into it, and saved it. I then changed its properties to rwx.rwx.rwx and executed it.  This failed because a number of directories did not exist according to the unlink command. But they do.  


I am starting to think that this is a lot of work that is not getting anywhere, and I do not know what to do now, so will give up on Blynk.


If anyone knows of another system that I can use to control my Raspberry Pi Model B rev 1 running Raspbian Stretch, I am willing to give it a try. 


[13/11/17] Ben suggests that I could put Alexa on my Raspberry Pi 3, but that reveals a problem. I'll have to convert my SD cards back to Jessie to support WebIOPi on my car, and to free up my MicroSD cards.   So SD card #1 will now be Jessie and WebIOPi, MicroSD card #3 will be stretch and available. 

[14/11/17] SD card #1 is now Jessie, running python 2.7.9 and all fitted up with WebIOPi, BUT it doesn't quite work.   I get the header, but not the buttons.  

Should it be Python 3? 

BRANCH: I have finally got the header pins soldered on to my Raspberry Pi Zero, and powered it on using  Micro SD card #3 which is:

cat /etc/os-release       -- Jessie

Python                        -- 2.7.9

It works completely

/BRANCH

Changed Html  and python script to the examples in the WebIOPi site. They didn't work 


How do I remove webIOPi? I'll start again, but I don't want to have to reimage.

[16/11/17]
Reinstalled webIOPi but it doesn't work because it gives an error GPIO not defined. 
I did a search and found: https://www.raspberrypi.org/forums/viewtopic.php?t=98981
see remark at Wed Jan 06 2016 by Brian. 

here is his page: http://www.blavery.com/BotSoftware-RPI/brian2012class.nfshost.com/where-are-we/index.html

Went to his pages and downloaded new copy and will try it. 

Used unzip Web* to unzip it, 
installed it, changed config file back to mine, and started it

Nope failed "GPIO is not defined." 

[17/11/17]
Start from fresh. Prepared SD card with Raspbian Jessie dated 2017-01-11
Added ssh file to both partitions! 
Added Interfaces and Wpa_supplicant files.
Added RC-car/html/index.html and rc-car/python/script.py
added webiopi-1.0.7-p zip file - saves moving it there later. The only other file I will have to put on is the webiopi config file. (I hope)

Now ssh into it, raspi-config to expand system to use whole memory, and update. This time I will not upgrade.

All done, and when I connect I get the header and the 404 favicon.ico not found. 

D.A.M.N.


Move on.
http://madsmaddad.blogspot.co.uk/2017/11/webiopi-is-obsolete-long-live.html























Saturday 28 October 2017

RC-Car-2 - RC car driven by Raspberry Pi

[28/10/17]
1.  I have a 6.4V Li-Ion battery that makes the motors go, so good. It was pointed out to me yesterday that most mobile phone batteries are Li-ion, but all of those that we have are 3.7 Volt, so unless I can stack them in series I can't use them.

2. I have four Memory cards. 
  [1] 16Gb contains ?
  [2] 8GB  boots up, has the correct IP address, but no WebIOPI. Plastic is breakingup.
  [4] 8GB MicroSD is good to go
  [5]? 8GB MicroSD is in car

3. How to proceed: 
  [a] Update [1] and [2] to latest Raspbian (done - Stretch)
   Wireless
   and WebIOPI, set up and test.
  [b] figure out how to change to have pcm control of Forward/Back.

4. Tools  that I use:
 ssh to connect
  Filezilla as an FTP client to transmit files between computers,
nano to edit files.

5. Which R-Pi ports support PWM?


[30/10/17] Card [2] in R-pi, Booted on Ethernet, Fing shows IP 192.168.1.20
ssh gets  Connection refused. Why?

FIX: As of the November 2016 release, Raspbian has the SSH server disabled by default. You will have to enable it manually. 
For headless setup, SSH can be enabled by placing a file named ssh, without any extension, onto the boot partition of the SD card.
-.-.-.-.- 

Then will sudo raspi-config
sudo apt-get update
sudo apt-get upgrade
edit /etc/network/interfaces and
/etc/network/wpasupplicant

reboot and see if wireless works.
NO.  and neither does Ethernet, so I can't fix it.
[3/11/17]
FIX: edited /etc/network/interfaces and /etc/wpasupplicant/wpa_supplicant.conf using sudo kate on PC.  Had to change the permissions of Wpa_supplicant.conf to r_xr_xr_x, but that got it connecting via IP 8.

use filezilla to copy WebIOPI zip file to R-Pi

At this point go to [*] below because this is debugging to get to that state and I am rewriting the process to show the steps.

ssh'd into R-Pi
$ tar xvzf WebIOPi-x.y.z.tar.gz
$ cd WebIOPi-x.y.z
$ sudo ./setup.sh
3 WebIOPi files to copy in:
/etc/webiopi/config                this shows where others should go.
myproject = /home/pi/rc-car/python/script.py
doc-root = /home/pi/rc-car/html   file index.html

edited config with nano to set it up, as I couldn't ftp it into place because of permissions.


started it with sudo webiopi -d -c /etc/webiopi/config but got errors that "GPIO is not defined"

need to add a couple of files and rebuild. See: 
1] http://webiopi.trouch.com/issues/140/

mv ../gpio.c python/native/gpio.c pi@raspberrypi ~/WebIOPi-0.7.1 
mv ../cpuinfo.c python/native/cpuinfo.c pi@raspberrypi ~/WebIOPi-0.7.1 
mv ../version.py python/webiopi/utils/version.py pi@raspberrypi ~/WebIOPi-0.7.1 
mv ../webiopi.js htdocs/webiopi.js 

or maybe this fix?
2] https://github.com/thortex/rpi3-webiopi/issues/12    Don't think so, doesn't give right output.

or
3] https://raspberrypi.stackexchange.com/questions/37327/global-name-gpio-is-not-defined-errors-on-webiopi

or
4] https://www.raspberrypi.org/forums/viewtopic.php?t=98981  has a couple of solutions.

or:
5] https://github.com/doublebind/raspi
will try this first.


]2017-11-04 15:51:35]
HTTP - DEBUG - "GET / HTTP/1.1" - 200 OK (Client: ::ffff:192.168.1.16
; Bush Spira B2 10 tablet Build/MRA58K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.98 Safari/537.36>)
2017-11-04 15:51:35 - HTTP - DEBUG - "GET /webiopi.js HTTP/1.1" - 200 OK (Client: ::ffff:192.168.1.16 ndroid 6.0; Bush Spira B2 10 tablet Build/MRA58K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.98 Safari/537.36>)
2017-11-04 15:51:35 - HTTP - DEBUG - "GET /jquery.js HTTP/1.1" - 200 OK (Client: ::ffff:192.168.1.16 droid 6.0; Bush Spira B2 10 tablet Build/MRA58K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.98 Safari/537.36>)
2017-11-04 15:51:35 - HTTP - DEBUG - "GET /webiopi.css HTTP/1.1" - 200 OK (Client: ::ffff:192.168.1.16 Android 6.0; Bush Spira B2 10 tablet Build/MRA58K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.98 Safari/537.36>
)
2017-11-04 15:51:36 - HTTP - DEBUG - "GET /map HTTP/1.1" - 200 OK (Client: ::ffff:192.168.1.16 6.0; Bush Spira B2 10 tablet Build/MRA58K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.98 Safari/537.36>)
2017-11-04 15:51:36 - HTTP - DEBUG - "GET /favicon.ico HTTP/1.1" - 404 Not Found (Client: ::ffff:192.168.1.16 Linux; Android 6.0; Bush Spira B2 10 tablet Build/MRA58K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.98 Safari/
537.36>)

It sort of worked, but didn't display buttons. 


[2017-11-06] Stuck an Icon called favicon in rc-car/html.
No errors but no buttons.

[*] New start place

ssh'd into R-Pi
$ tar xvzf WebIOPi-x.y.z.tar.gz
$ cd WebIOPi-x.y.z 
from  https://github.com/doublebind/raspi
$ wget https://raw.githubusercontent.com/doublebind/raspi/master/webiopi-pi2bplus.patch
$ patch -p1 -i webiopi-pi2bplus.patch
$ sudo ./setup.sh
3 WebIOPi files to copy in:
/etc/webiopi/config                this shows where others should go.
myproject = /home/pi/rc-car/python/script.py
doc-root = /home/pi/rc-car/html   file index.html

edited config with sudo nano to set it up, as I couldn't ftp it into place because of permissions.

started it with sudo webiopi -d -c /etc/webiopi/config

Tuesday 3 October 2017

Some people call them Brain Farts

Yesterday, I went upstairs to put a new duvet cover on the bed. At the top of the stairs I came across the Vacuum cleaner. I thought I had better dust before vacuuming so got out a duster. In the second room, I noticed that the window sill and curtain were dirty, so Took off the curtain and took it downstairs  and put it in a sink to soak.

Later in the day I got upstairs again, and this time got out the Jif and rag and cleaned up the window frame and even the window.


When did I get around to putting on the duvet cover?  Much later.

Thursday 31 August 2017

Economies of Scale

As a person who voted to leave the EU, I thought that I should get some of my thoughts  about why I voted this way into print.

Great Britain has always benefited from being an island nation. If we had been connected to the mainland in 1940 we would have been overrun and the world would be a different place.

But we now belong to an organisation that is mainly the countries of the mainland, and it is so large that it has lost the benefit of economies of scale in so many ways. It is not homogeneous enough in so may ways to work well. Do we need an EU armed force? But only a few countries would want to contribute to a navy.  It could be argued that we have a major possible opponent in Russia, but as in past wars, the armies of each country could work together if needed. Could a large armed force be easily controlled? Each country knows its own terrain best.

One of the major drawbacks  to the EU is the finances. They have not been able to do an annual reconciliation for many years, so when we in Britain ask for the bill for leaving, The EU is unable to calculate it.    Can GB calculate  what we think it should be? Yes, because we have a chancellor who looks after the financial departments of government and could, with a bit of push and shove, get the figures out of HMRC and others. Britain is slimming down many government departments, and making them more efficient. We now need to simplify our tax system.

The EU machinery is very top heavy because of the need to have representatives of each country in every department. I cannot imagine an EU with a single tax system for every person. This would be impossible to manage. That is why it has to be devolved. but to be properly devolved each country's tax system should be the same.

Is GB the right size for a good economy of scale? Suppose that GB were to break down. Could Scotland, Wales, England, Northern Ireland each build up their infrastructure to cope successfully? That's more people working for the government. And border controls?

If things were to break down even further to the concept of city states, such as Manchester and London being completely independent states then I think the whole concept of government will have broken down. Each would have it's own tax regime, administration, military and policing and external Foreign relations. Medical science would come to a halt, unless there was a medical science body that would help cross fertilisation of ideas, But where would it be based? None of these city-states would be big enough to negotiate business contracts with companies that are larger than they are. You start to wonder what proportion of the people of the British Isles would be involved in Government.

So I see Great Britain  being the appropriate size to be independent of the EU and able to manage it's own business.

Tuesday 15 August 2017

Playing with Linux Operating Systems

Because I have been a bit restricted in what I can do lately, I dug out my play computer and tried a few Linux OS's on it. Here is a bit of a report.

The computer is an ASUS P5K with 4GB of RAM, 153GB IDE hard disk with an IDE-SATA converter and a 15 inch monitor. It has a Wifi card that sits on the motherboard.

Initially the computer had a SATA hard disk with Zorin 11 on it. This had installed easily and worked fine. It is a 'simple' OS that is sort of an XP replacement.

I overwrote this with Parrot linux 3.7 as it was in one of the recommended lists. It had the old text based installer and went in without problems, and updated easily over the wifi.

I then changed this disk for the IDE with converter and installed KDE Neon 5.8.5 that I had downloaded back in January. This installed easily enough but I had a bit of trouble getting it to stay connected to the wifi. It wanted about 270 updates, and when you  hit the 'update all' button it overlayed a screen of all the files that were going to be updated, but it was a long list and you couldn't scroll down or see any way of removing it. Hitting the enter key did it. I had to try and update about 4 times over the wifi, because it kept stopping when the wifi failed and I was unable to restart it.  In the end I carted it indoors and wired the Ethernet in. It eventually updated. One of the features was that the machine refused to respond to the power down instructions. The only way I found to stop it was the power button.

Not happy so I installed Kali Linux 2016-1 over it. Once again a text based installer, it took it's time installing, but got there. It didn't mind that I went out for coffee, just kept working, not like the Neon.  it's quite fast, but the only login on it is root. I haven't found an office suite on it yet, but it is a dedicated security toolkit distro based on Backtrack and Helix.

Ah, well, if you're bored then you might be interested in trying
https://manjaro.org/  I haven't, but it's an Arch Linux derivative
with... a GUI installer!  The download page looks to have KDE flavour. -Ralph
That kept me from being bored. I downloaded the KDE version, and every time I booted it, my screen displayed a message " out of range " which implies that it cannot adjust the resolution to that of this ancient Toshiba 15".  This is a condition that I have seen years ago when a computer could not set the screen size. I  think that it is 'working' because every time I hit a key the CD runs up.  I booted into SolyDK and that worked OK, as does everything else.

I have a cheep IDE-to-SATA converter on the hard disk drive and it is giving me grief too as I keep swapping drives.

I used to be a great fan of Mandrake about 12-15 years ago, but didn't like Mandriva. I'll have to give the latest incarnation another try.

I tried Mageia, but could only find the XFCE version. I liked it because of the ease of installation and guidance, but on booting it always brought up a terminal window and needed a root login before proceeding to the GUI login. And it was dreadfully slow.  It says my screen is a 15"  Toshiba  with 1024x768 resolution.  I think someday I'll have to try it again as it doesn't seem right.

And at the end of it I decided that my IDE-toSata converter had a poor solder connection on the SATA connector so have had a go at fixing that.

Have given up/finished. Have now four HD's with PArrot, Kali, Mageia and Zorin that I can plug and play via the SATA cable.

Wednesday 7 June 2017

Don't vote Labour

The current state is that unemployment is the lowest that it has been since 1971, and there are more people in work.  https://www.ons.gov.uk/employmentandlabourmarket/peoplenotinwork/unemployment

This means more people paying income tax, and more revenue for the government. This means, if we don't spend it on other things, we can borrow less from the IMF, perhaps even get with some austerity to the point where we don't borrow any and can pay some back. This would reduce our Interest payments which are currently more than the Defence and Foreign Aid budgets. Following on from this, the more that we can reduce out interest payments, the more money we will have to spend (or pay down the capital).  We need a good government to do this.

Labour has grandiose plans and will carry on borrowing, which will increase our interest payments, therefore requiring us to borrow more to maintain the status quo, until the interest payments get SO large I don't want to think about the consequences. Remember that the previous labour government left a note: https://www.theguardian.com/commentisfree/2015/may/09/liam-byrne-apology-letter-there-is-no-money-labour-general-election


Friday 2 June 2017

Home Made Anemometer

For quite a long time I have wanted an anemometer to add to our weather station, but they all cost money, and the other day I read about  a project that used bearings from a disk drive on a low friction project.  I was wondering whether I could use the motor as a generator, but I read different things about disk drive motors. Sometimes it is said that they are dc drives, and sometimes stepper motors with three coils in a star configuration (four contacts). The unit that I have stripped down only has three contacts so I am wondering if the coils are in a delta configuration, and if that is the case , can I use a pulse from one coil to measure the rpm?

Does anybody know anything about disc drives?  The other suggestion I have seen is to use a bike speedometer hall effect sensor to capture the rpm.

I have glued 'cups' to the disk and it turns freely, I also need to find a place where the wind is constant around here.

Then I'll feed it into a R-Pi and make the output readable.

Suggestion 1 from DLUG: We used a 60 tooth wheel which makes calculation easy as it can be seconds or minutes (RPS, RPM).  Could use opto-coupler or hall effect chips.

Suggestion 2: I'd use an "Opto Interrupter", or "Beam Breaker" rather than an Opto-Coupler, this would apply to both projects. In the case of the anemometer, I'd fix an IR Receiver above the spinning cup shafts and and IR LED below them and count the number of times the beam is broken, dividing In the by the number of cup shafts if you want RPM.

A useful place to salvage opto switches and LED sources are old ball driven (not the "laser" sensor variety" computer mice. Pickup from the ball is usually via a spindle with an interrupter disk and then a quadrature detector, use one channel for a directionless speed. You'll also find similar on the scroll wheel of modern mice.

Extra points for just hacking the anemometer vane direct into the mouse scroll wheel. Then wind speed is just how fast the second scroll input to your PC is spinning.

----
Thinking back to my history with bar coding, and having an old ball mouse available, I made my own bars on the bottom of the disk.


I divided a circle into segments until I felt that I had enough (32) that I could darken in easily.


I cut out the bits marked with a blue felt tip pen.


I was going to use Pritt glue to glue the template on to the disk, but then thought that I might not be able to remove it, so cut out a bit more of the centre and used masking tape. I then used the automotive touch up paint to paint in the removed squares.


Remove the paper and this is what we have. It was a difficult picture to get because of the reflections from the silver surface.

Turn it over, the 'bars' are on the underside, protected from the elements, and here are the cups. They are made from a piece of plastic pipe  cut into thirds, and stuck with contact cement on to the disk.

Now I need to take the mouse circuitry and mount it below the disk. In it's mouse configuration it shines through the wheel, I need it here in a reflective mode. I have also discovered that the phototransistor on the mouse is two transistors with a common collector.

end for now.
My intention is to feed into a Raspberry Pi and then use WebIOPi to display the results on the tablet.



Thursday 18 May 2017

Two computers

Lets call these computers Downstairs and Upstairs. Downstairs is Windows XP and Upstairs is Kubuntu 16.04. It all starts when XP on Downstairs dies. I back it up and install Kubuntu 16.04, restore the data, and have to adjust the sizes of things because Kubuntu makes the most of the resolution available, and XP was reduced for the main user.  Reducing the resolution of Kubuntu gives an odd stretched display so I just expanded the sizes of the rows in the spreadsheets and increased the fonts.

This works fine for a week or two and then fails to start. The Motherboard has died. It was bought about 2005, so it has had a reasonable life. Got to keep this computer going, so bring Upstairs down and swap Hard Disks. So this computer is now U-D (Upstairs become Downstairs). The computer now known as D-U I put a motherboard I was given from Ben Campbell  into. This is an very fast Multi-core Mobo with 12 GB or RAM and it works very well. Only downside is that I lose my Windows 10 running  in VMware, but that could have been because of an upgrade to VMware.  Both computers are now working happily.

U-D is a bit noisy so I move it around a bit and then the monitor goes funny - into lower resolution or turning green. First thoughts are that it is the monitor cable so I swap that out, but it is not the solution. I then discover that the connector is loose on the Motherboard. Move the computers around again and swap hard disks, so D-U is now D-U-D and U-D comes back upstairs to be U-D-U. I put in a spare Video card and get that working so it is not using the video out on the motherboard.

All back working, but I have got my old computer back upstairs U-D-U and D-U-D is a super-duper 'gaming' computer that is only used for email and spreadsheets. In retrospect what I should have done is just put this video card in U-D  and left it downstairs.

Tuesday 31 January 2017

Trident Guidance System

So the military cannot fire a trident Missile from a submarine towards a target satisfactorily.

I wonder if it is possible to write a guidance program using a Raspberry Pi. The inputs would have to be the current GPS Location (2 fields) and the target GPS Location plus altitude (3 Fields).

I suppose, not being an expert, that from these input values the program would have to calculate the distance to the target allowing for curvature of the earth, and therefore how high the missile would have to go - the apogee.

Another thing that would be needed is a compass to determine the direction of flight.  This possibly can be determined by calculations on two successive GPS readings?  And knowing the orientation of the Missile. How would you know this? That way you would know which side rockets to fire or rudders to control to point it in the right direction.

How many inputs/outputs would you need? If it's anything like my RC-Car then two outputs for each of the north/south rudders and two for each of the east/west rudders, and appropriate inputs to give feedback on the positions of these rudders. Then there is the throttle control for the rocket motors, however that works.

A good start.



Tuesday 17 January 2017

Raspberry Pi Differences

The Problem that instigated this investigation was that I bought two Aqprox Wireless-N Nano USB Wireless adapters and could not get one to work on my test-rig Raspberry Pi. After doing all the usual swapping around, the conclusion was that there were differences in the R-Pi's that the adapter would not work on one, but was quite happy on the other.

As found from: http://www.raspberrypi-spy.co.uk/2012/09/checking-your-raspberry-pi-board-version/



pi@raspberrypi:~ $ cat /proc/cpuinfo               *** Model B  Revision 2
processor       : 0
model name      : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS        : 2.00
Features        : half thumb fastmult vfp edsp java tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xb76
CPU revision    : 7

Hardware        : BCM2708
Revision        : 000f
Serial          : 000000002dab1189
pi@raspberrypi:~ $

works with Ralink Ok

Last login: Mon Jan 16 09:17:15 2017               *** Model B revision 1
pi@raspberrypi:~ $ cat /proc/cpuinfo
processor       : 0
model name      : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS        : 697.95
Features        : half thumb fastmult vfp edsp java tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xb76
CPU revision    : 7

Hardware        : BCM2708
Revision        : 0002
Serial          : 000000004cb2f7c8
pi@raspberrypi:~ $

Fails with Ralink  ??? why?


http://elinux.org/RPi_HardwareHistory

www.element14.com/community/docs/DOC-78141/l/identifying-your-model-of-raspberry-pi
- Sorry, that's member only access.

http://www.raspberrypi-spy.co.uk/2012/09/raspberry-pi-board-revisions/

and for completeness:
en.wikipedia.org/wiki/Raspberry_Pi


From the elinux web site I ascertained that the unit that didn't work was a Model B Revision 1. It does not have any mounting holes. The one that does work is a Model B revision 2.  So I will label the procinfo outputs above.

Further research needed to determine why it doesn't work, but meanwhile I'll have to use the Zyxel wireless dongle

2017-01-18 Response from R-Pi forum:
The RPi B rev 1 has polyfuses in the power circuits of each USB port. The fuses limit the power too much for WIFI and so only low current devices such as keyboard and mouse will work. The fuses were removed in rev2 and power is directly connected to the 5V supply.
On my rev1 boards I removed the fuses and soldered wires across the pads to make them more like the Rev2 board.

So now we know.