2018-03-30
Starting from Raspian Jessie with fixed IP address.
In my folders this is Robot-6-Cayenne
https://mydevices.com/cayenne/landing/create-raspberry-pi-projects-with-cayenne/
First problem: It needs an app on a tablet. Have that.
It didn't work at first. I went in and deleted the /etc/webiopi/config file from the initial webIOPi configuration and then it connected.
Cayenne is NOT going to work with my setup as is because 3 GPIO pins are labelled as SPI pins and cannot be changed to I/O pins so I cannot control my left/right turning. These are GPIO 9,10 and 11.
I am still not certain that I could have had it working without Internet access.
I need to find out how to delete Cayenne so that I can use the R-Pi for another technique without having to flash it all again and start from scratch.
Friday, 30 March 2018
Thursday, 29 March 2018
Webiopi upgrade from Wheezy to Jessie
DECISION: Forget WebIOPi on Jessie. Let's do the next two things:
1. Cayenne.
2. AD-Hoc Networking
----------- ------------ ---------
Webiopi was working on a card with Raspbian Wheezy, then I updated and upgraded and I noticed that some files were labelled from Jessie.
After rebooting I couldn't get Webiopi to load. I could ssh into teh R-pi as normal, so I started the WebioPi service but I stiull could not load the web page. What follows is the log for WebIOPi. I'll look at it later to see if I can understand what to do.
2018-01-14 14:17:27 - WebIOPi - INFO - Starting WebIOPi/0.7.1/Python3.4
2018-01-14 14:17:27 - WebIOPi - INFO - GPIO - Native mapped to REST API /GPIO
2018-01-14 14:17:27 - WebIOPi - INFO - Loading configuration from /etc/webiopi/config
2018-01-14 14:17:28 - WebIOPi - INFO - Loading myproject from /home/pi/rc-car/python/script.py
2018-01-14 14:17:28 - WebIOPi - INFO - Access protected using /etc/webiopi/passwd
2018-01-14 14:17:28 - WebIOPi - INFO - HTTP Server binded on http://192.168.1.8:8000/
2018-01-14 14:17:28 - WebIOPi - INFO - CoAP Server binded on coap://192.168.1.8:5683/
2018-01-14 14:17:28 - WebIOPi - INFO - CoAP Server binded on coap://224.0.1.123:5683/ (MULTICAST)
2018-01-14 14:17:37 - WebIOPi - INFO - Starting WebIOPi/0.7.1/Python3.4
2018-01-14 14:17:37 - WebIOPi - INFO - GPIO - Native mapped to REST API /GPIO
2018-01-14 14:17:37 - WebIOPi - INFO - Loading configuration from /etc/webiopi/config
2018-01-14 14:17:37 - WebIOPi - INFO - Loading myproject from /home/pi/rc-car/python/script.py
2018-01-14 14:17:37 - WebIOPi - INFO - Access protected using /etc/webiopi/passwd
2018-01-14 14:17:37 - WebIOPi - INFO - HTTP Server binded on http://192.168.1.8:8000/
2018-01-14 14:17:37 - WebIOPi - INFO - CoAP Server binded on coap://192.168.1.8:5683/
2018-01-14 14:17:37 - WebIOPi - INFO - CoAP Server binded on coap://224.0.1.123:5683/ (MULTICAST)
2018-01-14 14:17:28 - WebIOPi - INFO - Starting WebIOPi/0.7.1/Python3.4
2018-01-14 14:17:28 - WebIOPi - INFO - GPIO - Native mapped to REST API /GPIO
2018-01-14 14:17:28 - WebIOPi - INFO - Loading configuration from /etc/webiopi/config
2018-01-14 14:17:29 - WebIOPi - INFO - Loading myproject from /home/pi/rc-car/python/script.py
2018-01-14 14:17:29 - WebIOPi - INFO - Access protected using /etc/webiopi/passwd
2018-01-14 14:17:29 - WebIOPi - INFO - HTTP Server binded on http://192.168.1.8:8000/
2018-01-14 14:17:29 - WebIOPi - INFO - CoAP Server binded on coap://192.168.1.8:5683/
2018-01-14 14:17:29 - WebIOPi - INFO - CoAP Server binded on coap://224.0.1.123:5683/ (MULTICAST)
2018-03-29 15:14:21 - WebIOPi - INFO - Stopping...
2018-03-29 15:14:22 - WebIOPi - INFO - CoAP Server stopped
2018-03-29 15:14:22 - WebIOPi - INFO - HTTP Server stopped
2018-03-29 15:14:52 - WebIOPi - INFO - Starting WebIOPi/0.7.1/Python3.4
2018-03-29 15:14:52 - WebIOPi - INFO - GPIO - Native mapped to REST API /GPIO
2018-03-29 15:14:52 - WebIOPi - INFO - Loading configuration from /etc/webiopi/config
2018-03-29 15:14:52 - WebIOPi - ERROR - name 'GPIO' is not defined
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/WebIOPi-0.7.1-py3.4-linux-armv6l.egg/webiopi/__main__.py", line 75, in
main(sys.argv)
File "/usr/local/lib/python3.4/dist-packages/WebIOPi-0.7.1-py3.4-linux-armv6l.egg/webiopi/__main__.py", line 69, in main
server = Server(port=port, configfile=configfile, scriptfile=scriptfile)
File "/usr/local/lib/python3.4/dist-packages/WebIOPi-0.7.1-py3.4-linux-armv6l.egg/webiopi/server/__init__.py", line 52, in __init__
self.gpio.addSetups(config.items("GPIO"))
File "/usr/local/lib/python3.4/dist-packages/WebIOPi-0.7.1-py3.4-linux-armv6l.egg/webiopi/devices/digital/gpio.py", line 62, in addSetups
self.addGPIOSetup(gpio, params)
File "/usr/local/lib/python3.4/dist-packages/WebIOPi-0.7.1-py3.4-linux-armv6l.egg/webiopi/devices/digital/gpio.py", line 55, in addGPIOSetup
self.addGPIO(self.gpio_setup, gpio, params)
File "/usr/local/lib/python3.4/dist-packages/WebIOPi-0.7.1-py3.4-linux-armv6l.egg/webiopi/devices/digital/gpio.py", line 45, in addGPIO
func = GPIO.OUT
NameError: name 'GPIO' is not defined
1. Cayenne.
2. AD-Hoc Networking
----------- ------------ ---------
Webiopi was working on a card with Raspbian Wheezy, then I updated and upgraded and I noticed that some files were labelled from Jessie.
After rebooting I couldn't get Webiopi to load. I could ssh into teh R-pi as normal, so I started the WebioPi service but I stiull could not load the web page. What follows is the log for WebIOPi. I'll look at it later to see if I can understand what to do.
2018-01-14 14:17:27 - WebIOPi - INFO - Starting WebIOPi/0.7.1/Python3.4
2018-01-14 14:17:27 - WebIOPi - INFO - GPIO - Native mapped to REST API /GPIO
2018-01-14 14:17:27 - WebIOPi - INFO - Loading configuration from /etc/webiopi/config
2018-01-14 14:17:28 - WebIOPi - INFO - Loading myproject from /home/pi/rc-car/python/script.py
2018-01-14 14:17:28 - WebIOPi - INFO - Access protected using /etc/webiopi/passwd
2018-01-14 14:17:28 - WebIOPi - INFO - HTTP Server binded on http://192.168.1.8:8000/
2018-01-14 14:17:28 - WebIOPi - INFO - CoAP Server binded on coap://192.168.1.8:5683/
2018-01-14 14:17:28 - WebIOPi - INFO - CoAP Server binded on coap://224.0.1.123:5683/ (MULTICAST)
2018-01-14 14:17:37 - WebIOPi - INFO - Starting WebIOPi/0.7.1/Python3.4
2018-01-14 14:17:37 - WebIOPi - INFO - GPIO - Native mapped to REST API /GPIO
2018-01-14 14:17:37 - WebIOPi - INFO - Loading configuration from /etc/webiopi/config
2018-01-14 14:17:37 - WebIOPi - INFO - Loading myproject from /home/pi/rc-car/python/script.py
2018-01-14 14:17:37 - WebIOPi - INFO - Access protected using /etc/webiopi/passwd
2018-01-14 14:17:37 - WebIOPi - INFO - HTTP Server binded on http://192.168.1.8:8000/
2018-01-14 14:17:37 - WebIOPi - INFO - CoAP Server binded on coap://192.168.1.8:5683/
2018-01-14 14:17:37 - WebIOPi - INFO - CoAP Server binded on coap://224.0.1.123:5683/ (MULTICAST)
2018-01-14 14:17:28 - WebIOPi - INFO - Starting WebIOPi/0.7.1/Python3.4
2018-01-14 14:17:28 - WebIOPi - INFO - GPIO - Native mapped to REST API /GPIO
2018-01-14 14:17:28 - WebIOPi - INFO - Loading configuration from /etc/webiopi/config
2018-01-14 14:17:29 - WebIOPi - INFO - Loading myproject from /home/pi/rc-car/python/script.py
2018-01-14 14:17:29 - WebIOPi - INFO - Access protected using /etc/webiopi/passwd
2018-01-14 14:17:29 - WebIOPi - INFO - HTTP Server binded on http://192.168.1.8:8000/
2018-01-14 14:17:29 - WebIOPi - INFO - CoAP Server binded on coap://192.168.1.8:5683/
2018-01-14 14:17:29 - WebIOPi - INFO - CoAP Server binded on coap://224.0.1.123:5683/ (MULTICAST)
2018-03-29 15:14:21 - WebIOPi - INFO - Stopping...
2018-03-29 15:14:22 - WebIOPi - INFO - CoAP Server stopped
2018-03-29 15:14:22 - WebIOPi - INFO - HTTP Server stopped
2018-03-29 15:14:52 - WebIOPi - INFO - Starting WebIOPi/0.7.1/Python3.4
2018-03-29 15:14:52 - WebIOPi - INFO - GPIO - Native mapped to REST API /GPIO
2018-03-29 15:14:52 - WebIOPi - INFO - Loading configuration from /etc/webiopi/config
2018-03-29 15:14:52 - WebIOPi - ERROR - name 'GPIO' is not defined
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/WebIOPi-0.7.1-py3.4-linux-armv6l.egg/webiopi/__main__.py", line 75, in
main(sys.argv)
File "/usr/local/lib/python3.4/dist-packages/WebIOPi-0.7.1-py3.4-linux-armv6l.egg/webiopi/__main__.py", line 69, in main
server = Server(port=port, configfile=configfile, scriptfile=scriptfile)
File "/usr/local/lib/python3.4/dist-packages/WebIOPi-0.7.1-py3.4-linux-armv6l.egg/webiopi/server/__init__.py", line 52, in __init__
self.gpio.addSetups(config.items("GPIO"))
File "/usr/local/lib/python3.4/dist-packages/WebIOPi-0.7.1-py3.4-linux-armv6l.egg/webiopi/devices/digital/gpio.py", line 62, in addSetups
self.addGPIOSetup(gpio, params)
File "/usr/local/lib/python3.4/dist-packages/WebIOPi-0.7.1-py3.4-linux-armv6l.egg/webiopi/devices/digital/gpio.py", line 55, in addGPIOSetup
self.addGPIO(self.gpio_setup, gpio, params)
File "/usr/local/lib/python3.4/dist-packages/WebIOPi-0.7.1-py3.4-linux-armv6l.egg/webiopi/devices/digital/gpio.py", line 45, in addGPIO
func = GPIO.OUT
NameError: name 'GPIO' is not defined
There's one thing --> GPIO is not defined.
things to try:
https://raspberrypi.stackexchange.com/questions/37327/global-name-gpio-is-not-defined-errors-on-webiopi
At the bottom of this is the suggestion that I start WebIOPi specifically via Python3. This gives the webIOpi menu and GPIO pin display, but doesnt operate them. It didn't start my web page.
Commands:
sudo /etc/init.d/webiopi stop
This first I think:
https://groups.google.com/forum/#!topic/webiopi/BGc-mcD3UEw
-- It won't work. My version number is the one already in the file.
things to try:
https://raspberrypi.stackexchange.com/questions/37327/global-name-gpio-is-not-defined-errors-on-webiopi
At the bottom of this is the suggestion that I start WebIOPi specifically via Python3. This gives the webIOpi menu and GPIO pin display, but doesnt operate them. It didn't start my web page.
Commands:
sudo /etc/init.d/webiopi stop
sudo python3 -m webiopi 8000
gives when stopped:
pi@raspberrypi:/var/log $ sudo python3 -m webiopi 8000 2018-03-30 10:41:36 - WebIOPi - INFO - Starting WebIOPi/0.7.1/Python3.4 2018-03-30 10:41:36 - WebIOPi - INFO - GPIO - Native mapped to REST API /GPIO 2018-03-30 10:41:36 - WebIOPi - WARNING - Access unprotected 2018-03-30 10:41:36 - WebIOPi - INFO - HTTP Server binded on http://192.168.1.8:8000/ 2018-03-30 10:41:36 - WebIOPi - INFO - CoAP Server binded on coap://192.168.1.8:5683/ 2018-03-30 10:41:36 - WebIOPi - INFO - CoAP Server binded on coap://224.0.1.123:5683/ (MULTICAST) ---------------------------------------- Exception happened during processing of request from ('::ffff:192.168.1.11', 46518, 0, 0) Traceback (most recent call last): File "/usr/local/lib/python3.4/dist-packages/WebIOPi-0.7.1-py3.4-linux-armv6l.egg/webiopi/protocols/http .py", line 238, in processRequest result = self.server.handler.do_GET(relativePath, compact) File "/usr/local/lib/python3.4/dist-packages/WebIOPi-0.7.1-py3.4-linux-armv6l.egg/webiopi/protocols/rest .py", line 147, in do_GET return (200, self.getJSON(compact), M_JSON) File "/usr/local/lib/python3.4/dist-packages/WebIOPi-0.7.1-py3.4-linux-armv6l.egg/webiopi/protocols/rest .py", line 245, in getJSON gpios[gpio][f] = GPIO.getFunctionString(gpio) NameError: name 'GPIO' is not defined
And lots more repeats of this.
????
Possibly this, but doesn't mention Jessiehttp://webiopi.trouch.com/issues/140/
This first I think:
https://groups.google.com/forum/#!topic/webiopi/BGc-mcD3UEw
-- It won't work. My version number is the one already in the file.
Wednesday, 28 March 2018
Second RC Car
MArch 2018,
I have another RC car that I have modified to be driven by a Raspberry Pi. I am using the same RAspberry Pi and software as I did on the first.
Here is a picture of the rig.
I have another RC car that I have modified to be driven by a Raspberry Pi. I am using the same RAspberry Pi and software as I did on the first.
Here is a picture of the rig.
The Hot glue gun is my new favourite tool. I used tabs of glue to hold this battery pack in, and glued the plastic battery holder (white plastic) to the body for the power pack
The electronics are simpler than on the previous car, as there are no feedback wires from the steering gear.
The IC is labelled RX2C which I take to mean receiver-2-channel and from the schematic I found which pins were the outputs to the motors, as labelled.
Here is the layout on the car. I brought the wires from underneath out to a strip of pins, and labelled them so that I can easily swap them out to try another controller if I get one. The leads from the Raspberry Pi are visible also coming from the GPIO pins to what had been the IC legs, replaced with pins. To have been tidier I should have bought some leads, but I just quickly cobbled these together.
It took a bit of testing to get these pins on the pin-strip correct, and the car turning left/right or backwards/forwards as desired. If I did it again I would put the Positive and Ground leads at either end of the strip to separate them.
Next thing to do is add a Youtube video of it in operation, then swap the controller board out for this Deek-Robot H Bridge controller that I have bought.
Wednesday, 7 March 2018
Challenge for DT in Secondary Schools.
How about 'Dorset Robo-Challenge Modelled on Robot wars, with competitions within the school throughout the year and an Interschool competition at the end of the year.
To make it interesting all robots to be controlled by Raspberry Pi, Micro:bot, or Arduino.
Obviously it needs some 'House' robots and pitfalls. I think a sideswiping axe from the middle of one side of the competition chamber and a box that has sides that flip up to enclose the 'bot when it gets on the centre.
Get local companies to provide a technical champion for each team?
To make it interesting all robots to be controlled by Raspberry Pi, Micro:bot, or Arduino.
Obviously it needs some 'House' robots and pitfalls. I think a sideswiping axe from the middle of one side of the competition chamber and a box that has sides that flip up to enclose the 'bot when it gets on the centre.
Get local companies to provide a technical champion for each team?
Friday, 19 January 2018
Big Christmas for repairs
Yes, the thing that stands out most about this Christmas is the number of repairs I have had to do in the last month.
1. Early December I was backing up Raspberry Pi images to my computer and it stopped - disk full. I made a bit of space and backed it up to my backup 500Gb disk. When I was disconnecting it I dropped it, and it wouldn't work any more. it just made a ticking sound. So Bought a new 1TB disk and took the seagate backup unit apart and replaced the disk, then did another full backup. I took apart the broken disk and moved the head to the innner resting place, and then tested it. It now works again.
2. The glass in the Father-son lamp broke and I found it all over the sofa in the morning. I got a new piece from Tappers (free), but it alos broke. the problem was that the little light bulb was too close to the glass and the filament in it was against the glass, so I bought some more bulbs and replaced that one.
3. Then the garage door spring broke on Christmas Eve. I ordered a new hook and fixed it. I wrote an Instructable on that.
4. The Microwave combination oven broke down in the middle of cooking a meal. The next morning I went out and bought a new one.
5. One of the curly light bulbs in the trilight in the dining room went out. I needed to source a new one. (Wilko)
6. A car headlight bulb was gone. I managed to get it out, but I couldn't get the clip in around the new one. I ended up having to take the bumper off to get the headlight out so that I could see what I was doing.
7. Sophie picked up my play RC car and it hasn't worked since. That's an ongoing project.
8. 18 January 2018 The breadmaker is making awful grinding noises in the vicinity of the drive belt. Phoned Morphy richards and they are going to send a new one. The warranty ran out on January 27 - 9 days time.
9. 18 January 2018. The car failed to start when we were out for our afternoon tea. I think that we have only been doing short runs with the lights on and it had been run down, but I managed to get it changed under warranty at Halfords today- about 3 months short of the end of the four year warranty.
When I remember the rest I'll add them
Now it's early February and the sole has come off my shoe. The shoe isn't that old so I'll take them back to Clarks and see what they can do.
1. Early December I was backing up Raspberry Pi images to my computer and it stopped - disk full. I made a bit of space and backed it up to my backup 500Gb disk. When I was disconnecting it I dropped it, and it wouldn't work any more. it just made a ticking sound. So Bought a new 1TB disk and took the seagate backup unit apart and replaced the disk, then did another full backup. I took apart the broken disk and moved the head to the innner resting place, and then tested it. It now works again.
2. The glass in the Father-son lamp broke and I found it all over the sofa in the morning. I got a new piece from Tappers (free), but it alos broke. the problem was that the little light bulb was too close to the glass and the filament in it was against the glass, so I bought some more bulbs and replaced that one.
3. Then the garage door spring broke on Christmas Eve. I ordered a new hook and fixed it. I wrote an Instructable on that.
4. The Microwave combination oven broke down in the middle of cooking a meal. The next morning I went out and bought a new one.
5. One of the curly light bulbs in the trilight in the dining room went out. I needed to source a new one. (Wilko)
6. A car headlight bulb was gone. I managed to get it out, but I couldn't get the clip in around the new one. I ended up having to take the bumper off to get the headlight out so that I could see what I was doing.
7. Sophie picked up my play RC car and it hasn't worked since. That's an ongoing project.
8. 18 January 2018 The breadmaker is making awful grinding noises in the vicinity of the drive belt. Phoned Morphy richards and they are going to send a new one. The warranty ran out on January 27 - 9 days time.
9. 18 January 2018. The car failed to start when we were out for our afternoon tea. I think that we have only been doing short runs with the lights on and it had been run down, but I managed to get it changed under warranty at Halfords today- about 3 months short of the end of the four year warranty.
When I remember the rest I'll add them
Now it's early February and the sole has come off my shoe. The shoe isn't that old so I'll take them back to Clarks and see what they can do.
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:
[2017/12/01]
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]
In WebIOPi I have to change all three files- Config, Index.html, and script.py
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.
[ 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.
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/
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.
[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:
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.
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 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.
[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.
Subscribe to:
Posts (Atom)