====== Other ======
* [[other:Hard drive based rotary table]]
* [[other:LMI rotary table]]
* [[other:3D printing a single line]]
* [[https://www.youtube.com/watch?v=9AaujAPghhE|Casting aluminum from a 3D print]]
* [[other:Raspberry Pi video looper]]
===== Workflows =====
* [[other:DXF to 3D print]]
===== Web-Print =====
* [[https://hogent.mynetpay.be/?view=easyprintgo|hogent.mynetpay.be]]
* Log in
* Kies zwart-wit of kleur (EDU of ADM maakt niet uit)
* Upload het bestand
* Ga naar de afdeling grafiek (verdieping 3)
* Leg KASK-kaart op de printer
* Selecteer je budget. Privé of ART1
* Klik op ''Secure print''
* Selecteer je file
* Klik 'print'.
===== Website =====
Formlab - Grav website CMS system
* Main page: blog
* child pages: item
===== Occulus Go =====
standalone VR goggles
Troubleshooting:
When controller doesn't want to connect, do a factory reset:
- Press power and volume-down button
- Navigate to the factory reset option with the volume buttons
- press OK with the power button
===== Assortments =====
* Hex socket cap bolts ([[https://docs.rs-online.com/b3b9/0900766b815834db.pdf|RS-components - 545 Piece stainless steel bolt kit]])
* M3 x 6, 8, 12
* M4 x 8, 12, 20
* M5 x 10, 12, 16, 20
* M6 x 12, 16, 20, 25
* Hex socket cap bolts (larger) ([[431 piece Stainless Steel Screw/Bolt Kit|RS-components - 431 piece Stainless Steel Screw/Bolt Kit]])
* M6 x 12, 16, 20, 25, 40
* M8 x 16, 20, 25, 30
* M10 x 20, 30, 40, 60
* M12 x 20, 40, 60
* Nuts ([[https://docs.rs-online.com/3601/0900766b815832db.pdf|RS-components - 1710 piece stainless steel hex kit]])
* M2
* M2,5
* M3
* M4
* M5
* M6
* M8
* M10
===== Join shared folder on Windows =====
* Open new explorer window
* Right-click on 'This PC'
* Click on ''Map Network Drive...''
* in 'Folder', write: \\IP-address-of-mac\shared-folder-name
* Enter the username and password the shared folder is connected to
===== Lumix GH5S Remote shutter release:=====
[[https://www.norwegiancreations.com/2018/07/controlling-a-camera-shutter-remotely-with-an-arduino/]]\\
I used this circuit with the 4N25 optocoupler: [[http://wei48221.blogspot.com/2016/06/how-to-use-4n25-optocoupler_27.html]]
{{:utilities:trigger-circuit.jpg?nolink&800|}}
To use this with a 3.3V trigger signal, the resistor going to input 1 on the optocoupler should be around 50Ω.
===== Raspberry Pi Videolooper =====
Download here: [[https://videolooper.de/|videolooper.de]]
Keep in mind that 1920x1080 is the max playable resolution.
==== Use other aspect ratio than 16/9 ====
If you want to use a aspect ratio other than 16/9, edit the config file ( /boot/config.txt ):
* comment out the line 'dtoverlay=vc4-fkms-v3d'
* comment out the line 'max_framebuffers=2'
Removing those functions allowed the raspberry pi videolooper to play non 1920x1080 footage.
[[https://github.com/adafruit/pi_video_looper/issues/64|Source]]
==== Run the svg2gcode web app locally ====
Disclaimer: I don't know what I'm doing, but it seems to work.
The [[https://sameer.github.io/svg2gcode/|svg2gcode]] webpage converts svg drawings to gcode for pen plotters. Very cool! But sometimes it's off line. That's where this local copy comes into play.
The code is written in [[https://www.rust-lang.org/|Rust]]. [[https://doc.rust-lang.org/cargo/|Cargo]] is the package manager for Rust. Packages are called crates. [[https://trunkrs.dev/|Trunk]] is a rust crate that is a web server and prepares code to be ran online and [[https://yew.rs/|Yew]] is another crate that takes the data from Trunk and provides the framework for front-end web applications.
=== Start the server ===
* Double click the file "svg2gcode-LOCAL.command". (only on the Desktop of the computer in Formlab)
* A terminal will show some text and a browser window with the local version of the svg2gcode page.
* What the script is doing is the following:
* In the Terminal, go to the folder of the web app: cd ~/Documents/trunk-server/svg2gcode-main/web
* trunk serve --open
=== Stop the server ===
* In the Terminal, type: CTRL+C
=== Install the server ===
Run these commands with the terminal.
* Install [[https://www.rust-lang.org/|Rust]]
* curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
* Press enter for default installation
* Configure the PATH variable: . "$HOME/.cargo/env"
* Reboot the terminal and test with: rustc --version
* Download Git repository (zip file): https://github.com/sameer/svg2gcode and unzip.
* In terminal, go into the downloaded folder: cd svg2gcode-main
* Build the cargo project cargo build --release
* Not sure if this is necessary, but it worked so keep doing this!
* Install trunk (a tool to automatically prepare rust projects for the web web using Web Assembly (WASM))
* cargo install trunk
(This did take a long time)
* Add the WASM (web assembly) build target:
* rustup target add wasm32-unknown-unknown
(prepare for any machine and serve for any kind of machine).
* Change the terminal location to the web folder (svg2gcode > web):
* cd web
* Run the cargo project:
* cargo run
* The commandline is busy downloading and compiling for a while, then shows "thread 'main' panicked at users/admin/.cargo/registry/src/index.crates.io..... numbers and letters...
* I think this might be an unnecessary step. Test perhaps? I didn't do anything with the warning...
* Start the server:
* trunk serve --open
* I got an error: problem with path for the spectre.scss file. The 'svg2gcode-main > web > style > spectre' was empty. A browser window opened, but didn't load a page.
* I downloaded the code folder from the [[https://github.com/picturepan2/spectre|spectre github]] (spectre-master), unzipped it and moved the contents of that folder to the spectre folder in svg2gcode-main > web > style > spectre. Instantly the terminal continued compiling.
* Reloading the page in the browser now shows a working local copy of the svg2gcode website.
* Test it by generating Gcode without wifi or ethernet connected.
===== Gcode based shutoff =====
Make the pen plotter (OpenBuilds Acro) shut down after plotting so it can plot even nobody is present in Formlab. This prevents the motors from staying hot for too long.
==== Overview ====
The G-code sender (Openbuilds Control) sends commands to the pen plotter.
Add this custom bit of gcode to quickly toggle the relay at the end of the plotting program:
M8 ; close relay
G4 P0.2 ; wait for 20ms
M9; open relay
The Arduino nano detects the relay closing as a pushbutton. When this happens, the Arduino will transmit the code over radio signal to turn off the remote switch.
{{:other:pen_plotter_gcode_based_shutoff_02.jpg?600|}}
==== Products ====
* Remote switch: [[https://www.bol.com/be/nl/p/klikaanklikuit-startset-3-schakelaars-met-afstandsbediening-alleen-geschikt-voor-belgie/9300000046885605/|Trust Start-line APC3-2300R smart home socket switch set]]
* Klik Aan Klik Uit (Alternate brand name)
* [[https://www.bol.com/be/nl/p/mini-nano-v3-0-atmega328p-microcontroller-bord-voor-arduino/9200000112027528/|Arduino nano]]
* Radio receiver & transmitter set (433,92Mhz)
* Search on Amazon for something like '433MHz RF Wireless Transmitter & Receiver Module Kit for Arduino'
==== Info ====
* [[https://www.instructables.com/Using-an-ESP8266-to-Control-Mains-Sockets-Using-43/|This guide]] used a socket with a different chipset, so this didn't work directly, but it was a good start.
* [[https://github.com/vdloo/homelabmanager/blob/master/Documentation/my_power_management.md|This guide]] pointed me to the right library that is compatible with the remote power plug
* Components
* Arduino Nano
* Bought at [[https://www.bol.com/be/nl/p/mini-nano-v3-0-atmega328p-microcontroller-bord-voor-arduino/9200000112027528/|Bol]]
* [[website: https://docs.arduino.cc/hardware/nano/|General info page]]
* [[https://docs.arduino.cc/resources/pinouts/A000005-full-pinout.pdf|Pinout]]
* vin: 7-12V
* Radio receiver - transmitter
* Bought at[[https://www.bol.com/be/nl/p/otronic-433mhz-rf-zender-en-ontvanger/9300000024801683/|Bol]]
* More info at [[https://www.otronic.nl/nl/433mhz-rf-zender-en-ontvanger-140567829.html|Otronic]]
* Some documentation on the wiring [[https://github.com/sui77/rc-switch/wiki/HowTo_Receive|here]]
* Receiver: Product Model MX-05V
* Transmitter: Product Model: MX-FS-03V
* Remote power socket
* Bought at [[https://www.bol.com/be/nl/p/klikaanklikuit-startset-3-schakelaars-met-afstandsbediening-alleen-geschikt-voor-belgie/9300000046885605/|Bol]]
* 433,92Mhz
* IC chip used in Trust APC32300R remote: CMT2157B 2232dQ0782
* In the end I didn't need this info
* Communication protocol info: https://manual.pilight.org/protocols/433.92/switch/kaku.html
* In the end I didn't need this info
==== Steps ====
* Populate breadboard
* Put the **Arduino nano** on a breadboard
* Plug in the **radio receiver** board (the longer one with 4 pins), so that no pins overlap with the Arduino
* Add jumper cables for GND and VCC (use the 5V from the Arduino nano)
* There's 2 pins left in the middle on the receiver board, but I think they're the same. Add a jumper from one of the middle pins to pin 2 on the Arduino
* Plug in the **radio transmitter** board (the square one), so that no pins overlap with other pins
* Connect VCC and Ground
* Add a jumper cable from the middle pin to pin 11 on the Arduino
* Add a cable from the 2 screw terminals of the relay output port of the OpenBuilds Blackbox to the breadboard and connect one lead to +5V and the other to pin 3. From there, also go to GND via a 10Kohm resistor. This is basically a setup for a button / switch
* Pair up the remote to a socket
* Plug in the socket to a power strip
* With the remote, click "on" 4 times to pair. Now the on - off pair on the remote works with the remote socket.
* Install the [[https://github.com/1technophile/NewRemoteSwitch|NewRemoteSwitch]] library
* Run the example project 'showreceived Code' on the Arduino
* Open the Arduino Terminal and press On and Off on the remote
* I got back the following info
* ON-signal:
* Code: 30980307 Period: 250
* unit: 0
* groupBit: 0
* switchType: 1
* OFF-signal
* Code: 30980307 Period: 250
* unit: 0
* groupBit: 0
* switchType: 0
* Open now the example sketch 'Lightshow'
* Change the line: NewRemoteTransmitter transmitter(**123**, 11, 260, 3);\\ to: NewRemoteTransmitter transmitter(**30980307**, 11, 260, 3); // (address, pin, period_microseconds, repeats)
* The big number is the received 'code' data from the remote.
* Also change the lines in the loop to use only these:
* Switch off with: transmitter.sendUnit(0, false);
* Switch on with: transmitter.sendUnit(0, true);
* Then upload the sketch to the Arduino and try it out. The remote socket should switch every 5 seconds.
* Open the Openbuilds Blackbox and change the Relay Jumper from the M3/M5 command config to the M8 M9 config. The M3 command is already used for setting the servo. See the docs [[https://docs.openbuilds.com/doku.php?id=docs:blackbox-4x:jumper-relay|here]].
* Tested successfully: M8 closes the Relay, M9 opens it. The plotter starts with the relay opened.
This is the code I'm using now:
/*
Plotter auto shutdown 01
For the Openbuilds Acro pen plotter.
The Gcode sender (Openbuilds Control) will send the following Gcode sequence after finishing a plot:
M8 ; close the relay
G4 P0.2 ; wait 20 MS
M9 ; open the relay
The relay is connected with the arduino nano with a cable. This signal can be detected as if it were a button press
When the arduino received the 'button press', it transmits a code so the remote power socket will switch off.
I'm using the Bounce2 library for debouncing and the NewRemoteTransmitter library for receiving and transmitting the 433Mhz radio remote signals.
Formlab
08/07/24
*/
#define BUTTON_PIN 3
#define LED_PIN 13
// https://github.com/thomasfredericks/Bounce2
#include
// Create a debouncer instance
Bounce2::Button button = Bounce2::Button();
// https://github.com/1technophile/NewRemoteSwitch/tree/master
#include
// Create a transmitter instance
NewRemoteTransmitter transmitter(30980307, 11, 260, 3); // address, pin, period_microseconds, repeats
void setup() {
// Button setup
button.attach(BUTTON_PIN, INPUT); // USE EXTERNAL PULL-UP
button.interval(5); // (ms)
button.setPressedState(LOW);
// LED setup
pinMode(LED_PIN, OUTPUT);
}
void loop() {
button.update();
if (button.pressed()) {
shutdown();
}
}
void shutdown() {
digitalWrite(LED_PIN, HIGH);
delay(100);
digitalWrite(LED_PIN, LOW);
delay(100);
digitalWrite(LED_PIN, HIGH);
delay(100);
digitalWrite(LED_PIN, LOW);
delay(100);
digitalWrite(LED_PIN, HIGH);
delay(100);
digitalWrite(LED_PIN, LOW);
delay(100);
transmitter.sendUnit(0, false); // switch off unit 0
}
===== Docuwiki troubleshooting =====
* On save: 'error security token did not match. Possible CSRF attack'.
* Check if webpage is in secure mode (https). If not, add https:// in front of it and reload.