Compare commits

...

5 commits

8 changed files with 1292 additions and 562 deletions

View file

@ -35,6 +35,9 @@ Each PCB connects to 10 LEDs, and the PCB can be chained together to
form a single WS2812 chain. There are 83 LEDs in the current version, so a total of 9 of these PCBs is required.
The ESP32-C3 needs to be soldered to the first PCB.
> :warning: **There is a small issue with V1.0 of the PCB!** (Please check the version number on the silk screen!):
> Pins 1 and 4 of the OUT pin header are swapped - this can be easily worked around by swapping wires number 1 and 4 in the JST connector plugged into this header.
### esp32/
The PlatformIO Arduino project for the ESP32. It perfoms the following tasks:
@ -51,12 +54,28 @@ export ESP32_WPA2_PSK=the-wifi-psk
pio run -t upload
```
### led_plugging_tool/
A 3D-printable tool that helps with cutting the LED legs to size and attach them to JST ZH-4 connectors the correct way.
Usage:
1. Print the tool on a 3D printer.
2. Put a LED bulb-first into the tool hole. Especially on first use, make sure that it's all the way in.
- The LED should only fit in one orientation.
3. Use a pair of wire cutters to cut the LED legs as close to the tool's surface as possible.
4. Take a cable fitted with JST ZH-4 connectors and push one connector firmly onto the LED legs inside the tool.
- The connector, too, should only (fully) fit in one orientation.
- You may need to bend the LED legs a little to get them to a pitch close enough to 1.5mm that the connector will slide on.
5. Pull the cable to remove the connector and LED from the tool.
6. Repeat steps 2-5 for every LED you need to prepare.
## Components
- WS2812-compatible 5mm bulb LEDs: https://de.aliexpress.com/item/1005005003701575.html
- Black 5mm LED sockets: https://de.aliexpress.com/item/1005005062684329.html
- ESP32-C3 Super Mini: https://de.aliexpress.com/item/1005006252882434.html
- JST-ZH cables: https://de.aliexpress.com/item/1005007298855435.html
- JST-ZH cables: https://de.aliexpress.com/item/1005007298855435.html (4P, Reversed)
[spaceapi]: https://spaceapi.io

View file

@ -16,8 +16,7 @@ lib_deps =
adafruit/Adafruit NeoPixel@^1.12.3
bblanchon/ArduinoJson@^7.1.0
sstaub/NTP@^1.6
tzapu/WiFiManager@^2.0.17
build_flags =
-D ARDUINO_USB_MODE=1
-D ARDUINO_USB_CDC_ON_BOOT=1
-D WPA2_SSID=${sysenv.ESP32_WPA2_SSID}
-D WPA2_PSK=${sysenv.ESP32_WPA2_PSK}

View file

@ -1,5 +1,6 @@
#include <Arduino.h>
#include <WiFiManager.h>
#include <WiFiClientSecure.h>
#include <WiFiUdp.h>
#include <NTP.h>
@ -8,14 +9,6 @@
#include "spacemap.h"
#ifndef WPA2_SSID
#define WPA2_SSID "my-wifi-ssid"
#endif
#ifndef WPA2_PSK
#define WPA2_PSK "change-me"
#endif
#define WIFI_RETRY 120
#define WS2812_PIN 0
#define WS2812_LEN (sizeof(spaces)/sizeof(char*))
#define WS2812_BS 5
@ -24,6 +17,7 @@
#define SPACEAPI_PATH "/"
WiFiManager wifiManager;
WiFiClientSecure client;
WiFiUDP wifiUdp;
NTP ntp(wifiUdp);
@ -31,46 +25,25 @@ NTP ntp(wifiUdp);
Adafruit_NeoPixel pixels(WS2812_LEN, WS2812_PIN, NEO_RGB | NEO_KHZ800);
JsonDocument json, filter;
void connectAndWait() {
if (!WiFi.status() != WL_CONNECTED) {
pixels.clear();
pixels.setPixelColor(0, pixels.Color(WS2812_BS*2, 0 , 0));
pixels.show();
Serial.println("\nConnecting to WiFi Network ..");
WiFi.mode(WIFI_STA);
WiFi.setTxPower(WIFI_POWER_15dBm);
WiFi.disconnect();
WiFi.begin(WPA2_SSID, WPA2_PSK);
}
uint16_t i = 0;
for (uint16_t i = 0; WiFi.status() != WL_CONNECTED && i < WIFI_RETRY; ++i) {
Serial.println(WiFi.status());
delay(250);
if (WiFi.status() == WL_DISCONNECTED) {
pixels.setPixelColor(0, pixels.Color(WS2812_BS*2*(i%2), 0, 0));
} else {
pixels.setPixelColor(0, pixels.Color(WS2812_BS*2*(i%2), WS2812_BS*(i%2), 0));
}
pixels.show();
}
if (i >= WIFI_RETRY) {
pixels.setPixelColor(0, pixels.Color(WS2812_BS, 0 , WS2812_BS));
pixels.show();
ESP.restart();
while (true) { Serial.print(""); };
}
Serial.println("\nConnected to the WiFi network");
Serial.print("Local ESP32 IP: ");
Serial.println(WiFi.localIP());
pixels.setPixelColor(0, pixels.Color(0, WS2812_BS*2, 0));
pixels.show();
}
void setup() {
Serial.begin(115200);
pixels.begin();
connectAndWait();
pixels.begin();
pixels.clear();
WiFi.setHostname("spaceapimap");
WiFi.setTxPower(WIFI_POWER_15dBm);
WiFi.enableIpV6();
WiFi.setAutoReconnect(true);
wifiManager.setDebugOutput(true);
wifiManager.setConnectTimeout(60);
wifiManager.setConfigPortalTimeout(300);
if (!wifiManager.autoConnect("spaceapimap", "12345678")) {
ESP.restart();
while (true);
}
ntp.begin();
// setup json filter
@ -81,7 +54,9 @@ void setup() {
}
void loop() {
connectAndWait();
uint32_t color0 = pixels.getPixelColor(0);
pixels.setPixelColor(0, color0);
ntp.update();
Serial.println(ntp.formattedTime("\nIt is %d.%m.%Y %H:%M UTC"));
time_t now = ntp.epoch();

View file

@ -25,17 +25,17 @@ const char* spaces[] = {
// 2
"https://www.devtal.de/api/",
"https://chaosdorf.de/space_api.json",
"https://api.koeln.ccc.de/",
"https://api.koeln.ccc.de",
"https://status.aachen.ccc.de/spaceapi",
"https://spaceapi.tdvenlo.nl/spaceapi.json",
"https://hackalot.nl/statejson",
"https://status.brixel.space/api/status",
"https://api.hsbxl.be/index.php/0.1/spaceapi/",
"https://spaceapi.voidwarranties.be/",
"https://spaceapi.voidwarranties.be",
"https://spaceapi.pixelbar.nl/",
// 3
"http://techinc.nl/space/spacestate.json",
"https://state.awesomespace.nl/",
"https://state.awesomespace.nl",
"https://bitlair.nl/statejson.php",
"https://space.nurdspace.nl/spaceapi/status.json",
"https://state.hackerspacenijmegen.nl/state.json",

View file

@ -0,0 +1,31 @@
$fn=60;
difference() {
union() {
difference() {
translate([-10,-10,-1]) {
cube([20,20,20]);
}
// bulb cutout
cylinder(h=20,d=5.2);
// bulb base cutout
translate([0,0,8]) {
cylinder(h=12,d=6.2);
}
}
// "anode" marker (it's not the anode on WS2812!)
translate([2.6,-5,7]) {
cube([2,10,12]);
}
}
// JST ZH-4 cutout
translate([-3.25,-2,16]) {
cube([6.5,3,5]);
}
// JST ZH-4 alignment slot cutout
translate([-4,-0.5,16]) {
cube([8,1,5]);
}
}

Binary file not shown.

File diff suppressed because it is too large Load diff

View file

@ -667,6 +667,141 @@
)
)
)
(symbol "Graphic:Logo_Open_Hardware_Small"
(exclude_from_sim no)
(in_bom no)
(on_board no)
(property "Reference" "#SYM"
(at 0 6.985 0)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(property "Value" "Logo_Open_Hardware_Small"
(at 0 -5.715 0)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(property "Footprint" ""
(at 0 0 0)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(property "Datasheet" "~"
(at 0 0 0)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(property "Description" "Open Hardware logo, small"
(at 0 0 0)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(property "Sim.Enable" "0"
(at 0 0 0)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(property "ki_keywords" "Logo"
(at 0 0 0)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(symbol "Logo_Open_Hardware_Small_0_1"
(polyline
(pts
(xy 3.3528 -4.3434) (xy 3.302 -4.318) (xy 3.175 -4.2418) (xy 2.9972 -4.1148) (xy 2.7686 -3.9624)
(xy 2.54 -3.81) (xy 2.3622 -3.7084) (xy 2.2352 -3.6068) (xy 2.1844 -3.5814) (xy 2.159 -3.6068)
(xy 2.0574 -3.6576) (xy 1.905 -3.7338) (xy 1.8034 -3.7846) (xy 1.6764 -3.8354) (xy 1.6002 -3.8354)
(xy 1.6002 -3.8354) (xy 1.5494 -3.7338) (xy 1.4732 -3.5306) (xy 1.3462 -3.302) (xy 1.2446 -3.0226)
(xy 1.1176 -2.7178) (xy 0.9652 -2.413) (xy 0.8636 -2.1082) (xy 0.7366 -1.8288) (xy 0.6604 -1.6256)
(xy 0.6096 -1.4732) (xy 0.5842 -1.397) (xy 0.5842 -1.397) (xy 0.6604 -1.3208) (xy 0.7874 -1.2446)
(xy 1.0414 -1.016) (xy 1.2954 -0.6858) (xy 1.4478 -0.3302) (xy 1.524 0.0762) (xy 1.4732 0.4572)
(xy 1.3208 0.8128) (xy 1.0668 1.143) (xy 0.762 1.3716) (xy 0.4064 1.524) (xy 0 1.5748) (xy -0.381 1.5494)
(xy -0.7366 1.397) (xy -1.0668 1.143) (xy -1.2192 0.9906) (xy -1.397 0.6604) (xy -1.524 0.3048)
(xy -1.524 0.2286) (xy -1.4986 -0.1778) (xy -1.397 -0.5334) (xy -1.1938 -0.8636) (xy -0.9144 -1.143)
(xy -0.8636 -1.1684) (xy -0.7366 -1.27) (xy -0.635 -1.3462) (xy -0.5842 -1.397) (xy -1.0668 -2.5908)
(xy -1.143 -2.794) (xy -1.2954 -3.1242) (xy -1.397 -3.4036) (xy -1.4986 -3.6322) (xy -1.5748 -3.7846)
(xy -1.6002 -3.8354) (xy -1.6002 -3.8354) (xy -1.651 -3.8354) (xy -1.7272 -3.81) (xy -1.905 -3.7338)
(xy -2.0066 -3.683) (xy -2.1336 -3.6068) (xy -2.2098 -3.5814) (xy -2.2606 -3.6068) (xy -2.3622 -3.683)
(xy -2.54 -3.81) (xy -2.7686 -3.9624) (xy -2.9718 -4.0894) (xy -3.1496 -4.2164) (xy -3.302 -4.318)
(xy -3.3528 -4.3434) (xy -3.3782 -4.3434) (xy -3.429 -4.318) (xy -3.5306 -4.2164) (xy -3.7084 -4.064)
(xy -3.937 -3.8354) (xy -3.9624 -3.81) (xy -4.1656 -3.6068) (xy -4.318 -3.4544) (xy -4.4196 -3.3274)
(xy -4.445 -3.2766) (xy -4.445 -3.2766) (xy -4.4196 -3.2258) (xy -4.318 -3.0734) (xy -4.2164 -2.8956)
(xy -4.064 -2.667) (xy -3.6576 -2.0828) (xy -3.8862 -1.5494) (xy -3.937 -1.3716) (xy -4.0386 -1.1684)
(xy -4.0894 -1.0414) (xy -4.1148 -0.9652) (xy -4.191 -0.9398) (xy -4.318 -0.9144) (xy -4.5466 -0.8636)
(xy -4.8006 -0.8128) (xy -5.0546 -0.7874) (xy -5.2578 -0.7366) (xy -5.4356 -0.7112) (xy -5.5118 -0.6858)
(xy -5.5118 -0.6858) (xy -5.5372 -0.635) (xy -5.5372 -0.5588) (xy -5.5372 -0.4318) (xy -5.5626 -0.2286)
(xy -5.5626 0.0762) (xy -5.5626 0.127) (xy -5.5372 0.4064) (xy -5.5372 0.635) (xy -5.5372 0.762)
(xy -5.5372 0.8382) (xy -5.5372 0.8382) (xy -5.461 0.8382) (xy -5.3086 0.889) (xy -5.08 0.9144)
(xy -4.826 0.9652) (xy -4.8006 0.9906) (xy -4.5466 1.0414) (xy -4.318 1.0668) (xy -4.1656 1.1176)
(xy -4.0894 1.143) (xy -4.0894 1.143) (xy -4.0386 1.2446) (xy -3.9624 1.4224) (xy -3.8608 1.6256)
(xy -3.7846 1.8288) (xy -3.7084 2.0066) (xy -3.6576 2.159) (xy -3.6322 2.2098) (xy -3.6322 2.2098)
(xy -3.683 2.286) (xy -3.7592 2.413) (xy -3.8862 2.5908) (xy -4.064 2.8194) (xy -4.064 2.8448)
(xy -4.2164 3.0734) (xy -4.3434 3.2512) (xy -4.4196 3.3782) (xy -4.445 3.4544) (xy -4.445 3.4544)
(xy -4.3942 3.5052) (xy -4.2926 3.6322) (xy -4.1148 3.81) (xy -3.937 4.0132) (xy -3.8608 4.064)
(xy -3.6576 4.2926) (xy -3.5052 4.4196) (xy -3.4036 4.4958) (xy -3.3528 4.5212) (xy -3.3528 4.5212)
(xy -3.302 4.4704) (xy -3.1496 4.3688) (xy -2.9718 4.2418) (xy -2.7432 4.0894) (xy -2.7178 4.0894)
(xy -2.4892 3.937) (xy -2.3114 3.81) (xy -2.1844 3.7084) (xy -2.1336 3.683) (xy -2.1082 3.683)
(xy -2.032 3.7084) (xy -1.8542 3.7592) (xy -1.6764 3.8354) (xy -1.4732 3.937) (xy -1.27 4.0132)
(xy -1.143 4.064) (xy -1.0668 4.1148) (xy -1.0668 4.1148) (xy -1.0414 4.191) (xy -1.016 4.3434)
(xy -0.9652 4.572) (xy -0.9144 4.8514) (xy -0.889 4.9022) (xy -0.8382 5.1562) (xy -0.8128 5.3848)
(xy -0.7874 5.5372) (xy -0.762 5.588) (xy -0.7112 5.6134) (xy -0.5842 5.6134) (xy -0.4064 5.6134)
(xy -0.1524 5.6134) (xy 0.0762 5.6134) (xy 0.3302 5.6134) (xy 0.5334 5.6134) (xy 0.6858 5.588)
(xy 0.7366 5.588) (xy 0.7366 5.588) (xy 0.762 5.5118) (xy 0.8128 5.334) (xy 0.8382 5.1054) (xy 0.9144 4.826)
(xy 0.9144 4.7752) (xy 0.9652 4.5212) (xy 1.016 4.2926) (xy 1.0414 4.1402) (xy 1.0668 4.0894)
(xy 1.0668 4.0894) (xy 1.1938 4.0386) (xy 1.3716 3.9624) (xy 1.5748 3.8608) (xy 2.0828 3.6576)
(xy 2.7178 4.0894) (xy 2.7686 4.1402) (xy 2.9972 4.2926) (xy 3.175 4.4196) (xy 3.302 4.4958) (xy 3.3782 4.5212)
(xy 3.3782 4.5212) (xy 3.429 4.4704) (xy 3.556 4.3434) (xy 3.7338 4.191) (xy 3.9116 3.9878) (xy 4.064 3.8354)
(xy 4.2418 3.6576) (xy 4.3434 3.556) (xy 4.4196 3.4798) (xy 4.4196 3.429) (xy 4.4196 3.4036) (xy 4.3942 3.3274)
(xy 4.2926 3.2004) (xy 4.1656 2.9972) (xy 4.0132 2.794) (xy 3.8862 2.5908) (xy 3.7592 2.3876)
(xy 3.6576 2.2352) (xy 3.6322 2.159) (xy 3.6322 2.1336) (xy 3.683 2.0066) (xy 3.7592 1.8288) (xy 3.8608 1.6002)
(xy 4.064 1.1176) (xy 4.3942 1.0414) (xy 4.5974 1.016) (xy 4.8768 0.9652) (xy 5.1308 0.9144) (xy 5.5372 0.8382)
(xy 5.5626 -0.6604) (xy 5.4864 -0.6858) (xy 5.4356 -0.6858) (xy 5.2832 -0.7366) (xy 5.0546 -0.762)
(xy 4.8006 -0.8128) (xy 4.5974 -0.8636) (xy 4.3688 -0.9144) (xy 4.2164 -0.9398) (xy 4.1402 -0.9398)
(xy 4.1148 -0.9652) (xy 4.064 -1.0668) (xy 3.9878 -1.2446) (xy 3.9116 -1.4478) (xy 3.81 -1.651)
(xy 3.7338 -1.8542) (xy 3.683 -2.0066) (xy 3.6576 -2.0828) (xy 3.683 -2.1336) (xy 3.7846 -2.2606)
(xy 3.8862 -2.4638) (xy 4.0386 -2.667) (xy 4.191 -2.8956) (xy 4.318 -3.0734) (xy 4.3942 -3.2004)
(xy 4.445 -3.2766) (xy 4.4196 -3.3274) (xy 4.3434 -3.429) (xy 4.1656 -3.5814) (xy 3.937 -3.8354)
(xy 3.8862 -3.8608) (xy 3.683 -4.064) (xy 3.5306 -4.2164) (xy 3.4036 -4.318) (xy 3.3528 -4.3434)
)
(stroke
(width 0)
(type default)
)
(fill
(type outline)
)
)
)
)
(symbol "Mechanical:MountingHole"
(pin_names
(offset 1.016)
@ -1575,10 +1710,6 @@
(at 106.68 121.92)
(uuid "45932999-6c16-4775-b1b0-67332f812193")
)
(no_connect
(at 254 71.12)
(uuid "645fa9fb-08d2-4423-b15c-9311ffd638f4")
)
(no_connect
(at 137.16 116.84)
(uuid "6dca4f0e-e279-4ad3-b6d4-4db443e3d1b9")
@ -1657,16 +1788,6 @@
)
(uuid "1d09fd65-0eed-4ab0-a747-f28f97c1f56c")
)
(wire
(pts
(xy 254 63.5) (xy 241.3 63.5)
)
(stroke
(width 0)
(type default)
)
(uuid "20a65437-b6a7-4c9c-b73a-590030188fce")
)
(wire
(pts
(xy 180.34 44.45) (xy 180.34 50.8)
@ -1719,7 +1840,7 @@
)
(wire
(pts
(xy 241.3 44.45) (xy 241.3 63.5)
(xy 241.3 44.45) (xy 241.3 71.12)
)
(stroke
(width 0)
@ -1817,6 +1938,16 @@
)
(uuid "5f2206a1-6c61-4974-af42-3019756ccc96")
)
(wire
(pts
(xy 241.3 71.12) (xy 254 71.12)
)
(stroke
(width 0)
(type default)
)
(uuid "616adf6f-5d7f-4f08-a313-bd0c3388b31e")
)
(wire
(pts
(xy 50.8 44.45) (xy 50.8 63.5)
@ -5492,6 +5623,70 @@
)
)
)
(symbol
(lib_id "Graphic:Logo_Open_Hardware_Small")
(at 186.69 173.99 0)
(unit 1)
(exclude_from_sim yes)
(in_bom no)
(on_board yes)
(dnp no)
(fields_autoplaced yes)
(uuid "ebd7c982-85ed-414f-a883-879d28e3281c")
(property "Reference" "#SYM1"
(at 186.69 167.005 0)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(property "Value" "Logo_Open_Hardware_Small"
(at 186.69 179.705 0)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(property "Footprint" "Symbol:OSHW-Logo2_7.3x6mm_SilkScreen"
(at 186.69 173.99 0)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(property "Datasheet" "~"
(at 186.69 173.99 0)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(property "Description" "Open Hardware logo, small"
(at 186.69 173.99 0)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(instances
(project ""
(path "/2fa595f2-db69-4d05-b558-7bff3ae0df71"
(reference "#SYM1")
(unit 1)
)
)
)
)
(symbol
(lib_id "power:GND")
(at 137.16 44.45 0)