Friday, July 22, 2022

Build a shackle guard

For an index to all my stories click this text

An acquaintance told me that he needed a shackleguard. And I never had heard about it. A bit of investigating (Google is your friend) and I found it online. A shackleguard is a disc with some holes in it. In the middle is a hole where you put a rope through. Lead the rope from the top through the hole. At the bottom you then tie a shackle to the rope. The shackleguard is wider as the shackle. The purpose is to prevent the metal shackle to slap against te boat and damage it. The guard is made of plastic and that is softer as the metal of the shackle and will not damage the boat. So it is a typical marine thing.

I would have posted a picture but they are (as I presume) copyrighted by the manufacturer, so Google it yourself and you will see how it works: https://www.google.com/search?q=shackle+guard&client=firefox-b-d&source=lnms&tbm=isch&sa=X&ved=2ahUKEwiPgcL_-rT3AhWtgf0HHQbFBHAQ_AUoAnoECAEQBA&biw=1211&bih=891&dpr=1

Challenge accepted. How difficult could it be to make one myself.



I started with drawing a solid circle in the Gimp (free picture editing software) and then put some holes in it.



Next I used the online website Convertio ( https://convertio.co/ ) to convert my jpg file to an SVG file.



Then the SVG file was imported in Tinkercad and given a hight of a few cm and a diameter of 58 mm and a hight of 16mm. This process was described in detail in a previous story which you can find here: http://lucstechblog.blogspot.com/2020/10/3d-printed-anchor-hook.html I did use different converting software in that story but the priciple stays the same.

When that was done I made a sphere with a diameter of 58 mm.



Then I created two boxes functioning as holes. One box was positioned about half a cm from the middle of the sphere and the other one about half a cem below the middle of the sphere.



The sphere and the boxes were grouped and a nice disc is that way created.



Lower the disc on the workplane.



Now put the model next to the sphere



Rotate the vieuw till you are looking on top of the model.



Create some cilinders that fit the holes and place them into the holes.



Select all 5 cilinders and convert them to holes.



Remove the model by selecting it and clicking delete.



Group the holes.



Move the holes as a group and center them on your disc.



Group the disc and the cilinder-ho;es and you are done.

You can now export your shackle guard as an STL file.



I imported the STL file in my creality slicer and sliced the design at .3mm That is a bit course but this design does not need details. It needs to be functional. The slicer shows that printing will take 47 minutes and that is a bit optimistic.



And here you go, the completed print.

All in all the designing took me about 45 minutes, and printing about an hour.
Please note that my design has a rounded edge while the original has a straight edge.

I printed this in PLA, because it is what I had at hand.
PLA is said to be deteriorating in the open. However my experience is different. My fence caps which I printed in 2015 still show no sign of falling apart:
http://lucstechblog.blogspot.com/2015/07/fence-caps-few-moths-ago-my-son-in-law.html

I don't know if any of you are interested in the STL file to print it yourself. If you want it, just drop me a note by e-mail.

Mission accomplished, my aquiantance glad and guess what: I earned myself a few boat trips this summer.

Till next time.
Have fun

Luc Volders

Friday, July 15, 2022

Pico W a first look

 For an index to all my stories click this text.

And suddenly Raspberry Pi surprised me again. Just like they did last year when the Raspberry Pi Pico was released out of the blue. This year they did it again. Out of the blue there was the Raspberry Pi Pico W. And the difference is that it has Wifi now.



Mind you this is not a linux board as we are used to from Raspberry Pi, but this is a microcontroller like the ESP8266 or ESP32.

The official language at this moment is MicroPython, just as on the original Pico.

I bought 4 of them and they work fantastic.
Loads of IO ports, loads of memory, USB for programming and an excellent price: 7,95 euro here in the Netherlands. This is a real competitor for the ESP8266 and ESP32. Even more because it is made in Europe and widely available here.

Lets first look at the specs which i copied shamelessly from the Raspberry Pi site:

21 mm × 51 mm form factor
RP2040 microcontroller chip designed by Raspberry Pi in the UK
Dual-core Arm Cortex-M0+ processor, flexible clock running up to 133 MHz
264kB on-chip SRAM
2MB on-board QSPI flash
2.4GHz 802.11n wireless LAN (Raspberry Pi Pico W and WH only)
26 multifunction GPIO pins, including 3 analogue inputs
2 × UART, 2 × SPI controllers, 2 × I2C controllers, 16 × PWM channels
1 × USB 1.1 controller and PHY, with host and device support
8 × Programmable I/O (PIO) state machines for custom peripheral support
Supported input power 1.8–5.5V DC
Operating temperature  -20°C to +70°C (Raspberry Pi Pico W and Pico WH)
Castellated module allows soldering direct to carrier boards (Raspberry Pi Pico and Pico W only)
Drag-and-drop programming using mass storage over USB
Low-power sleep and dormant modes
Accurate on-chip clock
Temperature sensor
Accelerated integer and floating-point libraries on-chip


Impressive !!!

Pico and Pico W


The picture shows an original Pico with the headers soldered on and the new Pico W. As you can see they have the same size and with headers the Pico W can be used on a breadboard. The difference shows in the big metal box on the left in which the Wifi part is housed. At the utmost left there is a triangle on the breadboard which is the Wifi Antenna. The design for the antenna was taken from the Raspberry pi Zero (Linux machines) series.

There are some changes which I want to share with you. As I just received them this just covers my first impressions and experiences.



Just like the original Pico the Pico W is sold without headers.
Headers are cheap but you have to solder them on yourself, so you will need some basic soldering experience.

Thonny

At first my Pico W's were not working. I really thought there was something wrong.

So I decided to have a look at the Thonny website. It seems that there is a new version. Thonny V 4.0. After installing that everything worked as a charm.

Make sure to install the latest version of Thonny to get started with your Pico W !!!

The internal Led

There is an on-board led just like the original pico has. The original Pico had the led attached to pin 25 but that is no longer the case. So to blink the on board led you need the following Micropython program:

import machine
import time

ledintern = machine.Pin("LED", machine.Pin.OUT)

while True:
    ledintern.on()
    time.sleep(1)
    ledintern.off()
    time.sleep(1)


The Timer library

The Timer library has changed a bit from the previous version.

Start with :

import time

then define a timer:

timer_one = Timer(period=5000, mode=Timer.ONE_SHOT, callback=lambda t:print(1))

and call the timer this way:

timer_one.init(period=5000, mode=Timer.PERIODIC, callback=BlinkLED)

More on this will be discussed in later stories.

Wifi !!!

For Wifi there is a new library that includes:
HTTP, Webserver, Websockets, Get requests.

I have been experimenting with the Wifi possibilities and they work like a charm. In the few days I have them in my posession I have already send and retrieved data from/to:
- Domoticz
- Dweet
- IFTTT
- Telegram
- Thingspeak

Update:

Also tested and working :
- HTTP webserver
- Socket webserver

Conclusion.

This is off course a very brief first look which I wrote 2 days after receiving my Pico W's and I am very impressed. The Raspberry foundation did a tremendous good job by supplying excellent hardware and a ready to work with software environment.
As the price is also excellent (as we are used from Raspberry Pi products) this will be a real winner and a serious contestant for the ESP series.

Till next time
Have fun

Luc Volders



Wednesday, July 13, 2022

Update for HTTPClient library and many of my ESP8266 projects.

 For an index to all my stories click this text

Important for anybody that has problems accessing webpages with the ESP8266.

Suddenly during the past few weeks when I was on a long earned holliday abroad several readers started to mail me. They seemed to have a problem with projects on my weblog. And as I could see it was not just with one project but with several projects. Then I saw that all these projects had one thing in common: the used the ESP8266HTTPClient library.

So I had to test the code myself. Several possible errors came to my mind. Myabe they used a different version of the Arduino IDE. I am using version 1.8.10 but maybe they were using the new version 2.0 or an older version. And another option was that these readers were using a different version of the ESP8266HTTPClient library. Something must be going on as multiple readers contacted me and they all had the same error.

Obsolete API

 

error: call to 'HTTPClient::begin' declared with attribute error: obsolete API, use ::begin(WiFiClient, host, port, uri)
   68 |   http.begin(host,port,url);
      |   ~~~~~~~~~~^~~~~~~~~~~~~~~



And there is the error. I got the same error !!!

So I start compiling the program with Arduino 1.8.10 and got the error. Over to Arduino IDE 2.0 and the error persisted.

Examining the error it actually tells what the problem is:

obsolete API, use ::begin(WiFiClient, host, port, uri)

So we are using an obsolete API. And obviously the http.begin() command has changed.

The solution.

Actually it took me a some time to find what the error was. To my annoyance there was no documentation easy found. And in the end  the solution actually is easy.

At the start of your program the necessary libraries are loaded with:

#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>


Then a bit further the http client is defined:

HTTPClient http;

Here you have to add the line:

WiFiClient client;

and then in the loop or any other part of the program where the http code is used you need to change:

http.begin(host,port,url);

into

http.begin(client, host,port,url);

This is taken from my program that sends data from a Wemos D1 mini to Domoticz.

The same applies, for example, the project where data is send to Whatsapp from the ESP. Here the program starts with:

#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>

HTTPClient http;
WiFiClient client;

const char* ssid = "YOUR ROUTERS NAME";
const char* password = "YOUR ROUTERS PASSWORD";


And in the loop the code is altered in:

      //Specify request destination
      tobesend = "http://api.callmebot.com/whatsapp.php?";
      tobesend = tobesend + "phone=+1234567890";
      tobesend = tobesend + "&text=The+button+on+the+ESP+was+pressed";
      tobesend = tobesend + "&apikey=123456";
      http.begin(client,tobesend);


And that is all. Just the last line is altered.

This affects every project on this weblog that uses the ESP8266HTTPClient library and I do want to update all the listings on the weblog. But that may take some time. For now you know how to alter the program code to get things working again.

Documentation ???

Actually there is no real documentation about this.
However checking the Github pages for the Arduino IDE I saw that they used the new code in the examples:



So maybe my readers and I should have started looking there ????

https://github.com/esp8266/Arduino/tree/master/libraries

Problem solved.

Till next time
Have fun

Luc Volders


Friday, July 8, 2022

Holliday 2022 with some minor privacy issues

For an index to all my stories click this text

You might have noticed that some weeks have past since my last posting on this web and that's because I was on a long earned holliday. Normally I do not discuss private issues on this weblog as I value my privacy but I can tell you that we went camping in France. And there I experienced some technical aspects that I do not want to keep from you.

Oh and yes: next to Dutch, English and German I speak and read French.

As said, we went camping and we do that with a tent. So we have to use the campings facilities for toilet and showers. And the showers are what interested me direct.


 

At registrating at the camping site we got a bracelet. And That was needed for showering. Two showers a day were included in the camping price. And that is where the bracelet came in.


 

In the showers there was a white plastic bulb,  a sign and a button. The bulb contains a RGB led (or multiple) that flashes white. When you press the bracelet to the sign in the middle the bulb starts flashing blue. This indicates that the sequence has started. You then have 9 minutes of nice hot water.
Pressing the button starts the shower. The bulb then flashes green. The shower then supplies 1.5 minute warm water. Pressing the button in that time again stops the shower and pressing again re-starts the water supply. This does not limit the 1.5 minute of warm water supply.
Pressing the button anew again you get 1.5 minute of warm water and the bulb flashes again green. After 3 times flashing green the bulb turns orange for 2 pressings and the last time pressing changes the flashing in red so you know it ius the last time.

If you do not need the 9 minutes just do not press the button anymore and after a few minutes the sequence stops automatically and the bulb starts flashing white again.

This involves some clever programming.
The bracelet off course contains an RFID and the shower wall an RFID reader. The clever part is not allowing you to press the button 6 times before your time is up, but allowing you to stop within each 1.5 minute and continue.
You could build such a system using an Arduino, ESP or a Raspberry Pi Pico or any other microcontroller.


 

But there is more.
Not only can the camping-site owner see how often you take a shower and limit that to 2 times a day he can also keep track of the busiest showring hours. That is also a benefit for you if you hate waiting. Just pick a quieter time. But it allows the owner also to keep track of the average showring time. At this camping site that is 4 minutes as you can see.

This makes people aware of the amount of water they are using and as a result they take less time for showering.

But this also is something I was a bit frowning upon.

Privacy issue 1

The camping site owner (and his co-workers) knowing my showering times, how many showers I take a day and how long they take is some kind of privacy invasion.

Camping entrance

Upon entering and leaving the camping there is a barrier. You can open it with a pin code that you get when registrating.



 

But then something strange happened.
For reasons I do not want to elaborate over here we had to move from one spot to another. And then suddenly the barrier code did not work anymore.
So I went to the reception and told them my problem. It seemed that when you move spots you also get a new code which they forgot to give me.

And that was something else I was frowning upon.

Privacy issue 2

Each camping spot has a number. And the barrier code is linked to the camping spot.
For entering the camping you need to use the code. But also for leaving you need to use the code. This means that the camping staff knows when you are present.

Privacy conclusion.

I do take these issues lightheartedly, and I never mentioned it to the camping staff.
However in these times when everybody is nagging about privacy issues with Google and Facebook etc this got me thinking.

French magazines.

Nowadays most French people speak english but there were times when this was different. Next to that French are chauvinistic. This manifested a few weeks ago in a french governmental rule that for computer related words the French words must be used. For example a computer is called an ordinateur, a printer an imprimante etc. etc.

So many magazines are translated in French like Magpi (a Raspberry Pi oriented magazine). And there are some magazines that are French only.

And then I found this (again).


I already bought an issue some years ago and the magazine still exists. And I am glad for that. It is a bi-monthly technical magazine that covers electronics and IOT in in-depth stories. Arduino, Raspberry and ESP are coivered. I always buy one of these when I can and I am always pleasantly surprised with the stories they publish. It is only in French though.

French IOT

And off course a large country as France have their own IOT industry. As we have Philips, Tuya etc. they have Avidsen.


 

At the French stores I saw Avidsen power-plugs, bridges, IP-cams, smart bulbs etc. I had not heard about the brand before but that means nothing. I am sure there are loads of brands I never heard about before.
Avidsen is a French brand https://www.avidsen.com/en/
I have not seen integration with Domoticz or Home Assistant yet but it's a big world out there and maybe I have not searched enough.

Big News !!

And last but not least there was big news while I was on my holliday.



 

The Raspberry foundation released a new version of the Raspberry Pi Pico. And what a release !! It is the Pico but now with Wifi amd for a killer price of just 7.50 Euro here in the Netherlands. Will this be the ESP killer ?? I have some on order and as soon as I have them on my desk I will give you a first impression.

Till next time.
Have a nice holliday

Luc