Friday, November 24, 2023
Low Tech & Co, laptops and nav stations
The links above will lead you to pages were you'll find all the required STL: files (for 3D printing) and descriptions of the required hardware.
Tuesday, June 27, 2023
Point par relèvement, avec ou sans lunettes
On était en mer ce week-end, et j'ai constaté quelque chose que je ne connaissais pas, et qui mérite d'être - au moins - partagé.
C'est l'influence de mes lunettes sur la déviation du compas de relèvement.
Au début, j'étais très fier de constater que je savais toujours faire un point, ne passons pas à côté des choses simples.
J'ai bien fait d'en profiter, car peu après, c'était n'importe quoi... Mais j'ai trouvé la cause du problème : c'est mes lunettes.
Sans lunettes:
À garder en tête (ou dans la poche)...
Ceci me rappelle ces "anciens" compas de relèvement qu'on tenait à bout de bras..., et qui étaient sans doute absous de cette déviation incongrue. Le premier que ça fait rire se ramasse une baffe.
Fair winds to all !
Wednesday, June 22, 2022
Gabor's law
We are not going to ban the printing press because there are idiots who write nonsense... But any technological advance can also give rise to all its perversions.Dennis Gabor.
La loi de Gabor
On ne va pas interdir l'imprimerie parce qu'il y a des andouilles qui écrivent des âneries... Mais toute avancée technologique peut aussi donner lieu à toutes ses perversions.Dennis Gabor.
Wednesday, July 14, 2021
Another (new) concept?
We would call it Flake Computing, as opposed to Cloud Computing.
Think of it like Cloud Computing without Internet...
For example, you are on your boat, crossing an ocean, you do not pay those big fees to get a satellite communication and connexion, but your boat is equipped with sensors - TCP (or so) enabled. You have a single board computer on board (<- now THAT's a good one! like a Raspberry Pi, BeagleBone, etc), that can emit its own network, WiFi or not.
Nothing is preventing you from pulling the data emitted by the sensors, to process and compute them. Networks and Internet are different things... LAN, WAN, etc. (EZ: Entropy Zero...)
And nothing is preventing laptops, tablets, cell-phones or any such devices to get connected to the same network, to display the data processed by the single-board computer in a nice Web GUI (or any other GUI).
More later.
Friday, February 26, 2021
Night at 8
| Language | Eight | Night |
|---|---|---|
| English | eight | night |
| French | huit | nuit |
| Spanish | ocho | noche |
| Portuguese | oito | noite |
| Italian | otto | notte |
| Latin | octo | nocte |
| German | acht | nacht |
| Dutch | acht | nacht |
| Britton | eizh | noz |
| Norwegian | åtte | natt |
| Romanian | opt | nopți |
Friday, January 22, 2021
Several configurations for a Raspberry Pi Laptop
The Raspberry Pi is a cool single-board computer, modular, onto which you can hook up web cam, loudspeakers, external hard drives, all kinds of devices.
It has wireless and bluetooth connectivity, several USB ports, an Ethernet port. It has everthing I expect from a computer.
It can play music and movies, with the new Raspberry Pi 4 and its 8 Gigabytes of RAM, I can even do real development work without any problem, with tools like PyCharm or IntelliJ.
The Raspberry Pi 400 has recently been released, this is a very cool configuration to think about. For 100.00 USD it comes with the board (4Gb of RAM), a keyboard and a mouse. "All" you need to add is one (or two) HDMI screen(s).
A desktop HDMI screen can be an expensive device...
Along the same lines, below are a couple of configs I came up with before the Raspberry Pi 400 was released..., keeping in mind that those configs are mobile configs, not desktop ones.
The different configurations presented here can be acheived for less than 150.00 USD. And they do work for real.
Note: The configurations presented below have small screens... But nothing is preventing you to plug in a big one.
Here are several configurations for a small Raspberry Pi based laptop, to be taken on the go.
Click on the pictures to enlarge them.
The links in the text below will lead you somewhere in this git repo, with all the STL files and details on the hardware used for each configuration.
In its Pelican box, with a 7" touchscreen (no keyboard needed, it's like a tablet). The Raspberry Pi is behind the screen, ducked in the foam.
With a wood and plexiglass custom case, a breadboard, wireless keyboard with touchpad, and a 7" HDMI screen
| Same config, but without the holder, in a Pelican case | It all fits in |
| Putting things to work | At work! |
| In the box, closed. | Connecting the loudspeakers |
| Unpacking | At work. |
With an Adafruit 3.5" TFT, as explained here: Same config, with another enclosure (all STL files available here):
And there is a Raspbian OS 64-bit version in preview... I'm looking forward to the 16Gb version of the Raspberry Pi 4!
Sunday, November 29, 2020
Mac Look and Feel, on a real computer!
Definitely something to check out: Twister OS.
It runs on pretty much any Raspberry Pi 4, it comes loaded with tons of cool apps, and it possibly looks like a Mac Desktop 😀.
I'll look deeper into it, but it sounds already promising!
Thursday, November 26, 2020
PKIX path building failed
I was gradle'ng on the Raspberry Pi Zero as usual, and during a build, I had the following message:
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Friday, November 20, 2020
Raspberry Pi based fully featured small laptop
The full project is here, with the STL and OpenSCAD files for 3D printing, and the list of parts.
It comes with screen, keyboard, touchpad, speakers, camera, USB ports...
It plays movies, music, fully featured!! And for less than $100.
Friday, May 29, 2020
Raspberry Pi 4 with 8GB of RAM...
(See the Raspberry Pi blog).
And it comes along with a beta-64 bit OS, named Raspi OS, that targets Raspberry Pis 3 and higher.
I tried it (on a Raspberry Pi 4, with 4 Gb of RAM), it works fine, and fast!
This beta version does not come with Java installed, but a simple sudo apt-get install default-jdk installs it (JDK 11) in a couple of minutes.
I cloned a repo (https://github.com/OlivierLD/raspberry-coffee.git) and built it without any problem or error.
Now, I might wait a bit longer to get a new Raspberry Pi. As it is now, it should be able to support 16 Gb of RM, I'll wait a bit, and see...
Anyway, that makes yet another good reason NOT to get a Mac.
Steve Jobs vs Eben Upton..., I vote for Eben Upton, biiiiiig time.
Friday, May 22, 2020
Using OpenCV to downgrade an image
- We start from the colored image
- We turn it to gray
- We thresh it
- We resize it (smaller)
- We store it in a file, custom format
- We can then display the image on the led matrix (oled screen here)
| Original | Grayed |
|
|
| Threshed | Resized |
|
|
threshold part.
See in
OpenCVSwingColor2BW.java:
// threshold
Mat threshed = new Mat();
Imgproc.threshold(gray,
threshed,
150, // 127,
255,
0);
Tweaking the thresh parameter (150 above) leads to different results.
The final result is stored in a binary file (
image.dat).
The matrix used here is 128x64 pixels big. The file will contain 64 lines of 2
longs.
A Java
long has 64 bits, 2 longs make 128 bits, that's all we need to encode one line of 128 leds on the screen.
See the code in
OpenCVSwingColor2BW.java for details.
Adios Papou
Thursday, January 09, 2020
dAISy AIS HAT for the Raspberry Pi
Just received the dAISy HAT from Wegmatt, it just works!
Whoever can click can do it.
And this was the opportunity to keep working on the AISParser, and I have also added a custom TCP Forwarder to the Multiplexer, along with an AIS filter on the regular TCP Forwarder.
This way, you can forward NMEA data on one port, and AIS data on another one. This is not necessary, but it can be nice to have.
Here is an example of a yaml driving the Multiplexer:
#
# MUX definition.
#
name: "With a GPS and AIS"
context:
with.http.server: true
http.port: 9999
init.cache: true
channels:
- type: serial
# GPS
port: /dev/ttyUSB0
baudrate: 4800
verbose: false
- type: serial
# AIS
port: /dev/ttyS0
baudrate: 38400
verbose: false
forwarders:
- type: tcp
port: 7002
properties: no.ais.properties
- type: tcp
subclass: nmea.forwarders.AISTCPServer
port: 7003
computers:
- cls: nmea.computers.AISManager
properties: ais.mgr.properties
And OpenCPN is happy in both cases.
See more details here.
Friday, August 30, 2019
Wednesday, July 17, 2019
Sunday, April 21, 2019
San Juan Islands, WA
Tuesday, March 12, 2019
Easy Low Pass Filter
function lowPass(alpha, value, acc) {
return (value * alpha) + (acc * (1 - alpha));
}
Then you need to define your APLHA coefficient:
const ALPHA = 0.015;Then you can invoke the accumulator with the aplha coefficient on the data to smooth:
let filteredGustArray = [];
let acc = 0;
data.data.forEach(dp => {
acc = lowPass(ALPHA, dp.gust, acc);
filteredGustArray.push(acc);
});
This produces an array containing the smoothed data.
Here is a representation of what it looks like, along with the data to smooth (raw data in red, smoothed data in blue):
The demo data are available here.
Just run the script with nodejs like
$ node max.gust.js both > data.csvThis will produce a
csv file you can then import into any spreadsheet program, to see the figure above.
Monday, March 11, 2019
Smart TCP Watch, prototype.
Monday, November 26, 2018
Saturday, August 25, 2018
Smart watch..., who's smart, who's watching?
Then a while back, Pebble got acquired by Fitbit. And now, the Cloud IDE of Pebble is not available anymore. Than means I cannot develop new apps for my Pebble, even if it is still working just fine.
Why would I buy a new watch (twice as expensive), and re-write all my apps? This is quite frustrating...
In fact, there was something wrong from the beginning.
All those so-called smart watches need a Bluetooth cell-phone to connect to, and from there it will reach other data. Why not a TCP-based protocol from the watch, to bypass the phone? Power consumption? I doubt it.
This is not about accessibility or configuration either, I do it all the time for Raspberry Pis and similar boards,
ssh and similar protocols have been here for this kind of remote access, for ages, and for good reasons.
Smart glasses, head-up displays (HUD), smart watches, all those devices are just displays, all they need is to connect to a data bus and display what they mean to (just like an NMEA bus).
I suspect some marketing bullshit behind the scene..., again.
If this kind of TCP watch does not show up soon, I'll build one. Bam!
Saturday, July 14, 2018
Raspberry PI, PWM, servos, and PCA9685
Pulse Width Modulation (PWM) is the technique used from a digital source to simulate an analog output.
For example, imagine that you want to dim an
led from a digital device, to make it look like it is glowing.
The digital device only has pins that can take 2 values: 0 or 3V3.
0 means that the led will be off, 3V3 means it will be on, at 100% of its brightness.
In short, it is on or off, and there is nothing in between.
But here is an idea to work around that issue:
To show it at
50% of its brightness, the idea is to turn it off 50% of the time, and on 50% of the time.
To show it at
25% of its brightness, it will be on 25% of the time, and off 75% of the time.
If the on-off cycles are short and fast enough, a human eye will no be able to see them, it will only have the illusion of the resulting brightness.
A human eye cannot make the distinction between images separated by less than one 10th of a second. That is why the movies are shot at 24 images per second, so you cannot tell the difference between the frames.
This technique is call Persistence of Vision (POV).
The #1 parameter of PoV is the human retina. To have an idea of how much it is important, just put your cat in front of a TV, and see how much he/she reacts. To a cat, it might just be a fuzzy screen...
- The early movies - like Charlie Chaplin's silent ones - were shot at 16 images per second, fast enough to induce POV. They were later projected by faster projectors - 24 frames per second. That is why the characters seem to move faster. They were originally moving normally.
Here are examples of PWM applied to POV:
The Raspberry PI does not have analog pins, we need to use Pulse Width Modulation to simulate analog values, a servo is an analog device.
We use for that the method
setPWM(channel, 0, pulse), that will eventually write to the registers
of the device.
An instruction like
setPWM(channel, 0, pulse) means:
- On channel
channel(0to15on thePCA9685) - in each cycle, turn the power
onbetween0andpulse.
pulse has a value between 0 and 4095, that is 4096 distinct values, 4096 is 212, the PCA9685 is a 12 bit device.
The frequency
The frequency is provided in Hertz (Hz). A frequency of 60 means 60 cycles per second.At 60 Hz, a cycle will be
1 / 60 second, which is 0.01666666 second, or 16.66666 milli-second (ms).
The pulse
For each of the cycles set above by setting the frequency, we need to determine theint value,
between 0 and 4095, corresponding to the pulse in milliseconds we want to simulate with PWM.
In the class
i2c.servo.pwm.PCA9685.java, this is done in this method:
public static int getServoValueFromPulse(int freq, float targetPulse) {
double pulseLength = 1_000_000; // 1s = 1,000,000 us per pulse. "us" is to be read "micro (mu) sec".
pulseLength /= freq; // 40..1000 Hz
pulseLength /= 4_096; // 12 bits of resolution. 4096 = 2^12
int pulse = (int) Math.round((targetPulse * 1_000) / pulseLength); // in millisec
if (verbose) {
System.out.println(String.format("%.04f \u00b5s per bit, pulse: %d", pulseLength, pulse));
}
return pulse;
}
The cycle length (in ms) obviously depends on the frequency.
The pulse required for the servo to work is emitted once per cycle.
Example
As an example, let us calculate for a60 Hz frequency the pulse value to send to setPWM(channel, 0, pulse)
for a 1.5 millisecond PWM:
- 1 cycle has a duration of
1 / 60second, or16.66666milliseconds. - each cycle is divided in
4096slots, we can say that4096bits =16.6666ms. - the solution is provided by a rule of three:
value=4096* (pulse/16.66666), which is368.64, rounded to369.
A comment about servos' compliance and reliability
Theoretically, servos follow those rules:| Pulse | Standard | Continuous |
|---|---|---|
| 1.5 ms | 0 ° | Stop |
| 2.0 ms | 90 ° | FullSpeed forward |
| 1.0 ms | -90 ° | FullSpeed backward |
0.5 ms and 2.5 ms.
Before using them, servos should be calibrated. You can use the class
i2c.samples.IntercativeServo.java can be used for that,
you set the pulse values interactively, and you see what the servo is doing.
$> ./inter.servo Connected to bus. OK. Connected to device. OK. freq (40-1000) ? > 60 Setting PWM frequency to 60 Hz Estimated pre-scale: 100.72526 Final pre-scale: 101.0 Servo Channel (0-15) : 1 Entry method: T for Ticks (0..4095), P for Pulse (in ms) > p Enter 'quit' to exit. Pulse in ms > 1.5 setServoPulse(1, 1.5) 4.0690 μs per bit, pulse:369 ------------------- Pulse in ms > 0.5 setServoPulse(1, 0.5) 4.0690 μs per bit, pulse:122 ------------------- Pulse in ms > 0.6 setServoPulse(1, 0.6) 4.0690 μs per bit, pulse:147 ------------------- Pulse in ms > 2.4 setServoPulse(1, 2.4) 4.0690 μs per bit, pulse:589 ------------------- Pulse in ms > 2.5 setServoPulse(1, 2.5) 4.0690 μs per bit, pulse:614 ------------------- ... etc.Once you have determined the appropriate min and max values, you also have the
int values
to feed the setPWM with.
Some links:
- https://github.com/OlivierLD/raspberry-pi4j-samples/blob/master/I2C.SPI/PWM.md
- http://raspberrypi.lediouris.net/servo/readme.html
- POV at work































