mirror of
https://github.com/cecio/USBvalve.git
synced 2025-12-06 03:41:45 +00:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f6de47e149 | ||
|
|
4d730aecdb | ||
|
|
44e98ad924 | ||
|
|
7d218c974d | ||
|
|
f93f2b8fcb | ||
|
|
5ae2c31403 | ||
|
|
f96689ad6b | ||
|
|
896a9b8e26 | ||
|
|
c9d6a29ae9 | ||
|
|
4b87082395 | ||
|
|
977296e820 |
@@ -25,11 +25,10 @@ RUN cd /app \
|
||||
&& arduino-cli --additional-urls https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json core search 2040 \
|
||||
&& arduino-cli --additional-urls https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json core install rp2040:rp2040 \
|
||||
&& arduino-cli lib install "Adafruit TinyUSB Library" \
|
||||
&& arduino-cli lib install "ssd1306" \
|
||||
&& arduino-cli lib install "Adafruit SSD1306" \
|
||||
&& arduino-cli lib install "Pico PIO USB" \
|
||||
&& arduino-cli lib install "XxHash_arduino" \
|
||||
&& arduino-cli lib install "GFX Library for Arduino" \
|
||||
&& arduino-cli lib install "SSD1306Ascii"
|
||||
&& arduino-cli lib install "GFX Library for Arduino"
|
||||
|
||||
# Compilation setup
|
||||
RUN echo "#!/bin/bash" > /app/entrypoint.sh \
|
||||
|
||||
BIN
PCB/USBpipe/BOM_USBpipe_Rev1.ods
Normal file
BIN
PCB/USBpipe/BOM_USBpipe_Rev1.ods
Normal file
Binary file not shown.
BIN
PCB/USBpipe/BOM_USBpipe_Rev1.x.xlsx
Normal file
BIN
PCB/USBpipe/BOM_USBpipe_Rev1.x.xlsx
Normal file
Binary file not shown.
BIN
PCB/USBpipe/Gerber_USBpipe_Rev1.1.zip
Normal file
BIN
PCB/USBpipe/Gerber_USBpipe_Rev1.1.zip
Normal file
Binary file not shown.
BIN
PCB/USBpipe/PCB_USBpipe_Rev1.x.png
Normal file
BIN
PCB/USBpipe/PCB_USBpipe_Rev1.x.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 90 KiB |
4754
PCB/USBpipe/PCB_USBpipe_Rev1.x.svg
Normal file
4754
PCB/USBpipe/PCB_USBpipe_Rev1.x.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 336 KiB |
33
README.md
33
README.md
@@ -52,7 +52,7 @@ This is also fully compatible with the [Waveshare RP2040-LCD-1.28](https://www.w
|
||||
|
||||
`pictures`: images and resources used in this doc
|
||||
|
||||
`STL`: STL files for enclosure. In `1.1` and `1.2` folders there are full enclosures (thanks to [WhistleMaster](https://github.com/WhistleMaster)). If you want something lighter to protect the LCD you can go with `USBvalve_sliding_cover.stl`.
|
||||
`STL`: STL files for enclosure. In `1.1` and `1.2` folders there are full enclosures (thanks to [WhistleMaster](https://github.com/WhistleMaster)). In folders `1.2_64` and `1.2_64_simple` there are enclosures for the 128x64 screen (thanks to [rtmq0227](https://github.com/rtmq0227)). If you want something lighter to protect the LCD you can go with `USBvalve_sliding_cover.stl`.
|
||||
|
||||
## Build USBvalve
|
||||
|
||||
@@ -67,6 +67,8 @@ If you want to build your own, you need:
|
||||
|
||||
### Building instructions
|
||||
|
||||
> Thanks to [Tz1rf](https://github.com/Tz1rf) we have a great [Video](https://youtu.be/7ymk8hD7-Hc) explaining the building process step-by-step.
|
||||
|
||||
Almost all the job is done directly on the board by the software, so you just need to arrange the connection with the OLED for output.
|
||||
|
||||
Starting from version 0.8.0 of the firmware, **USBvalve** can detect HID devices (used to detect *BADUSB*). This require an additional USB port behaving as Host. If you are not interested in this, you can use the old instructions [in docs folder](https://github.com/cecio/USBvalve/blob/main/docs/BUILDING-1.1.md) and use PCB version `1.1`. Otherwise go ahead with PCB version `1.2` (we have version for USB-A or USB-B, see folder).
|
||||
@@ -125,6 +127,22 @@ The mapping is the following:
|
||||
|
||||
If you want to use the DEBUG functions, you can also place a header on the 3 SWD PINs at the bottom of the board.
|
||||
|
||||
#### With USBpipe PCB
|
||||
|
||||
> [!CAUTION]
|
||||
> This PCB is for experienced electronic makers
|
||||
> **DON'T USE IT IF YOU AREN'T SURE YOU CAN HANDLE IT!**
|
||||
|
||||
<img src="./pictures/USB_pipe_finished_oled.jpg" alt="USBpipe PCB"/>
|
||||
|
||||
[USBpipe](https://github.com/LiPolymer/smartUSBPipe) is a dedicated PCB for this project.
|
||||
|
||||
You can find everything you need in `./PCB/USBpipe/` folder.
|
||||
|
||||
<img src="./pictures/USB_pipe_front.png" alt="Front"/>
|
||||
|
||||
<img src="./pictures/USB_pipe_back.png" alt="Back"/>
|
||||
|
||||
### Flash Firmware
|
||||
|
||||
To flash the firmware, follow these steps:
|
||||
@@ -172,8 +190,8 @@ I grouped most of the variables you may want to modify in this section ([see Doc
|
||||
Obviously you can also build your own firmware. To build the *standard* one I used:
|
||||
|
||||
- Arduino IDE `2.3.2`
|
||||
- `Adafruit TinyUSB Library` version `3.1.1`, `Pico-PIO-USB` version `0.5.2`, Board `Raspberry Pi RP2040 (3.7.2)` setting Tools=>CPU Speed at `120MHz` and Tools=>USB Stack to `Adafruit TinyUSB`
|
||||
- `ssd1306` OLED library version `1.8.3`
|
||||
- `Adafruit TinyUSB Library` version `3.1.4`, `Pico-PIO-USB` version `0.5.2`, Board `Raspberry Pi RP2040 (3.8.1)` setting Tools=>CPU Speed at `120MHz` and Tools=>USB Stack to `Adafruit TinyUSB`
|
||||
- `Adafruit_SSD1306` OLED library version `2.5.10`
|
||||
|
||||
If you want to re-create a new fake filesystem, you may want to have a look to the `utils` folder, where I placed some utilities to build a new one.
|
||||
|
||||
@@ -196,6 +214,13 @@ If you have ideas or improvements in your mind, I encourage you to open an issue
|
||||
|
||||
If you have question or need support you can open an `Issue` here or reach me out on Twitter/X [@red5heep](https://twitter.com/red5heep)
|
||||
|
||||
### Community versions
|
||||
|
||||
The Community created some forks implementing support for other boards, or other modifications. **Thank you to everyone** who contributed to the development of **USBvalve**.
|
||||
Here below an unofficial/incomplete/unsupported list:
|
||||
- [USBvalve-tbfa-Mod](https://github.com/TryBreakFixAgain/USBvalve-tbfa-Mod)
|
||||
|
||||
## SAFETY WARNING
|
||||
|
||||
I've received a lot of questions about **USBvalve** and *USB killer devices*. **USBvalve** is not built to test these devices, it has not any kind of insulation or protection, so if you have the suspect you are dealing with one of these devices, test it with something else, NOT with **USBvalve** or you may damage the device, yourself or objects near to you.
|
||||
> [!WARNING]
|
||||
> I've received a lot of questions about **USBvalve** and *USB killer devices*. **USBvalve** is not built to test these devices, it has not any kind of insulation or protection, so if you have the suspect you are dealing with one of these devices, test it with something else, NOT with **USBvalve** or you may damage the device, yourself or objects near to you.
|
||||
|
||||
BIN
STL/1.2_64/renclosure.stl
Normal file
BIN
STL/1.2_64/renclosure.stl
Normal file
Binary file not shown.
BIN
STL/1.2_64/renclosure_backplate.stl
Normal file
BIN
STL/1.2_64/renclosure_backplate.stl
Normal file
Binary file not shown.
BIN
STL/1.2_64/renclosure_spacer.stl
Normal file
BIN
STL/1.2_64/renclosure_spacer.stl
Normal file
Binary file not shown.
BIN
STL/1.2_64_simple/SimpleEnclosurex64.stl
Normal file
BIN
STL/1.2_64_simple/SimpleEnclosurex64.stl
Normal file
Binary file not shown.
BIN
STL/1.2_64_simple/SimpleEnclosurex64_backplate.stl
Normal file
BIN
STL/1.2_64_simple/SimpleEnclosurex64_backplate.stl
Normal file
Binary file not shown.
BIN
STL/1.2_64_simple/SimpleEnclosurex64_spacer.stl
Normal file
BIN
STL/1.2_64_simple/SimpleEnclosurex64_spacer.stl
Normal file
Binary file not shown.
@@ -35,7 +35,11 @@
|
||||
|
||||
#else
|
||||
|
||||
#include "SSD1306AsciiWire.h"
|
||||
#include <SPI.h>
|
||||
#include <Wire.h>
|
||||
#include <Adafruit_GFX.h>
|
||||
#include <Adafruit_SSD1306.h>
|
||||
|
||||
// LED Pin. If solid GREEN everything is OK, otherwise it will be put OFF
|
||||
#define LED_PIN 25
|
||||
|
||||
@@ -78,9 +82,10 @@ Arduino_GFX *gfx = new Arduino_GC9A01(bus, GFX_RST, 1 /* rotation */, true /* IP
|
||||
|
||||
#define I2C_ADDRESS 0x3C // 0X3C+SA0 - 0x3C or 0x3D
|
||||
#define RST_PIN -1 // Define proper RST_PIN if required.
|
||||
#define OLED_WIDTH 128
|
||||
#define OLED_HEIGHT 32 // 64 or 32 depending on the OLED
|
||||
#define OLED_LINES (OLED_HEIGHT / 8)
|
||||
SSD1306AsciiWire display;
|
||||
|
||||
Adafruit_SSD1306 display(OLED_WIDTH, OLED_HEIGHT, &Wire, RST_PIN);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -111,7 +116,7 @@ bool activeState = false;
|
||||
//
|
||||
// USBvalve globals
|
||||
//
|
||||
#define VERSION "USBvalve - 0.17.0"
|
||||
#define VERSION "USBvalve - 0.18.1"
|
||||
boolean readme = false;
|
||||
boolean autorun = false;
|
||||
boolean written = false;
|
||||
@@ -204,30 +209,18 @@ void setup() {
|
||||
gfx->draw16bitRGBBitmap(10,0,background,210,210); // Draw background
|
||||
delay(2000);
|
||||
#else
|
||||
Wire.begin();
|
||||
Wire.setClock(400000L);
|
||||
#if OLED_HEIGHT == 64
|
||||
#if RST_PIN >= 0
|
||||
display.begin(&Adafruit128x64, I2C_ADDRESS, RST_PIN);
|
||||
display.begin(SSD1306_SWITCHCAPVCC, I2C_ADDRESS, RST_PIN);
|
||||
#else
|
||||
display.begin(&Adafruit128x64, I2C_ADDRESS);
|
||||
#endif
|
||||
#else
|
||||
#if RST_PIN >= 0
|
||||
display.begin(&Adafruit128x32, I2C_ADDRESS, RST_PIN);
|
||||
#else
|
||||
display.begin(&Adafruit128x32, I2C_ADDRESS);
|
||||
#endif
|
||||
display.begin(SSD1306_SWITCHCAPVCC, I2C_ADDRESS);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(PIWATCH)
|
||||
// gfx->setTextSize(tsb);
|
||||
gfx->setTextSize(1);
|
||||
gfx->setTextColor(MAGENTA);
|
||||
#else
|
||||
display.setFont(Adafruit5x7);
|
||||
display.setScrollMode(SCROLL_MODE_AUTO);
|
||||
display.setTextSize(1);
|
||||
#endif
|
||||
|
||||
cls(); // Clear display
|
||||
@@ -430,11 +423,46 @@ void printout(const char *str)
|
||||
} else {
|
||||
gfx->print(str);
|
||||
}
|
||||
|
||||
// Output on serial device
|
||||
SerialTinyUSB.println(str);
|
||||
}
|
||||
#else
|
||||
|
||||
void scrollUp(uint8_t pixels) {
|
||||
// Read the current content of the display, shift it up by 'pixels' rows
|
||||
display.startscrollright(0x00, 0x07); // Dummy values to initiate scroll
|
||||
display.stopscroll(); // Immediately stop to manually shift pixels in memory
|
||||
for (int i = 0; i < display.height() - pixels; i++) {
|
||||
for (int j = 0; j < display.width(); j++) {
|
||||
uint8_t color = display.getPixel(j, i + pixels);
|
||||
display.drawPixel(j, i, color);
|
||||
}
|
||||
}
|
||||
|
||||
// Clear the freed space after scrolling
|
||||
display.fillRect(0, display.height() - pixels, display.width(), pixels, SSD1306_BLACK);
|
||||
// Refresh the display to show the changes
|
||||
display.display();
|
||||
}
|
||||
|
||||
void checkAndScroll() {
|
||||
// Assumes text height of 8 pixels, but check for 16 because newline is not used
|
||||
if ((display.getCursorY() + 16) > display.height()) {
|
||||
// Scroll up by 8 pixels
|
||||
scrollUp(8);
|
||||
display.setCursor(0, display.getCursorY() - 8);
|
||||
}
|
||||
}
|
||||
|
||||
void printout(const char *str)
|
||||
{
|
||||
checkAndScroll();
|
||||
display.print(str);
|
||||
display.display();
|
||||
|
||||
// Output on serial device
|
||||
SerialTinyUSB.println(str);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -450,7 +478,9 @@ void cls(void) {
|
||||
#else
|
||||
// Clear display
|
||||
void cls(void) {
|
||||
display.clear();
|
||||
display.clearDisplay();
|
||||
display.setTextColor(SSD1306_WHITE);
|
||||
display.setCursor(0, 0);
|
||||
printout(VERSION);
|
||||
printout("\n-----------------");
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
pictures/USB_pipe_back.png
Normal file
BIN
pictures/USB_pipe_back.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 124 KiB |
BIN
pictures/USB_pipe_finished.jpg
Normal file
BIN
pictures/USB_pipe_finished.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.0 MiB |
BIN
pictures/USB_pipe_finished_oled.jpg
Normal file
BIN
pictures/USB_pipe_finished_oled.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.0 MiB |
BIN
pictures/USB_pipe_front.png
Normal file
BIN
pictures/USB_pipe_front.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 136 KiB |
Reference in New Issue
Block a user