beeper / beepy Goto Github PK
View Code? Open in Web Editor NEWBeepy
Home Page: https://beepy.sqfmi.com
License: Apache License 2.0
Beepy
Home Page: https://beepy.sqfmi.com
License: Apache License 2.0
I want to use the LED from user space on the rpi0w, but I can't figure out how to access i2c while the keyboard driver is running. I can see the rp2040 on bus 1, but can't set the LED register.
In REV A, you might wire another co-located LED to rpi GPIO, separate from the rp2040. I get that you need an indication of bootloader mode, but it makes it hard to access from user space.
Since there's no backlighting on the SHARP display, why enable the keyboard backlighting? It's not like you can use the device in the dark.
I think you should comment that out in the default firmware: https://github.com/sqfmi/i2c_puppet/blob/3010ada26a19612a54fb7e8258af5c5e1b93fffb/app/main.c#L36
I'm a fan of filling with ground plane. In v2, I think you should fill both sides with ground plane. If you did that, you could flip the RPI over and heat sink it to the ground plane. If you stitch the edges with via, it will help transfer heat from one side to the other.
Flipped RPi with ground plane fill:
Ground plane stitching example:
Hey, not sure if this is the right place to report this, but the documentation site seems to be down.
Hello, I noticed you have the electrical/wiring schematics for the board in the repo but not files for printing the PCB - could we get those added please? ๐โค๏ธ
steps to reproduce:
Remove this logic. It fills up dmesg with unnecessary logs.
int fpsThreadFunction(void* v)
{
while (!kthread_should_stop())
{
msleep(5000);
printk(KERN_DEBUG "FPS sharp : %d\n", fpsCounter);
fpsCounter = 0;
}
return 0;
}
Current boot time is 60s, the goal is 10s, however this can be reduced up to 2s.
This can be done in multiple stages:
I was able to get LGVL working on the beepberry, but I had to apply the attached patch to the Sharp display kernel module.
diff --git a/sharp.c b/sharp.c
index 523e5c9..3ee8205 100644
--- a/sharp.c
+++ b/sharp.c
@@ -67,7 +67,7 @@ static struct fb_var_screeninfo vfb_default = {
.yres = 240,
.xres_virtual = 400,
.yres_virtual = 240,
- .bits_per_pixel = 24,
+ .bits_per_pixel = 8,
.grayscale = 1,
.red = { 0, 8, 0 },
.green = { 0, 8, 0 },
@@ -88,7 +88,7 @@ static struct fb_var_screeninfo vfb_default = {
static struct fb_fix_screeninfo vfb_fix = {
.id = "Sharp FB",
.type = FB_TYPE_PACKED_PIXELS,
- .line_length = 1200,
+ .line_length = 400,
.xpanstep = 0,
.ypanstep = 0,
.ywrapstep = 0,
@@ -106,7 +106,7 @@ static struct fb_ops vfb_ops = {
};
static struct task_struct *thread1;
-static struct task_struct *fpsThread;
+//static struct task_struct *fpsThread;
static struct task_struct *vcomToggleThread;
static int vfb_mmap(struct fb_info *info,
@@ -212,6 +212,7 @@ int vcomToggleFunction(void* v)
return 0;
}
+/*
int fpsThreadFunction(void* v)
{
while (!kthread_should_stop())
@@ -222,6 +223,7 @@ int fpsThreadFunction(void* v)
}
return 0;
}
+*/
int thread_fn(void* v)
{
@@ -273,7 +275,7 @@ int thread_fn(void* v)
{
for(i=0 ; i<8 ; i++ )
{
- pixel = ioread8((void*)((uintptr_t)info->fix.smem_start + (x*8 + y*400 + i)*3));
+ pixel = ioread8((void*)((uintptr_t)info->fix.smem_start + (x*8 + y*400 + i)));
if(pixel)
{
@@ -312,7 +314,7 @@ static int sharp_probe(struct spi_device *spi)
{
char our_thread[] = "updateScreen";
char thread_vcom[] = "vcom";
- char thread_fps[] = "fpsThread";
+// char thread_fps[] = "fpsThread";
int retval;
screen = devm_kzalloc(&spi->dev, sizeof(*screen), GFP_KERNEL);
@@ -332,11 +334,13 @@ static int sharp_probe(struct spi_device *spi)
wake_up_process(thread1);
}
+/*
fpsThread = kthread_create(fpsThreadFunction,NULL,thread_fps);
if((fpsThread))
{
wake_up_process(fpsThread);
}
+*/
vcomToggleThread = kthread_create(vcomToggleFunction,NULL,thread_vcom);
if((vcomToggleThread))
@@ -404,7 +408,7 @@ static void sharp_remove(struct spi_device *spi)
framebuffer_release(info);
}
kthread_stop(thread1);
- kthread_stop(fpsThread);
+// kthread_stop(fpsThread);
kthread_stop(vcomToggleThread);
printk(KERN_CRIT "out of screen module");
//return 0;
I installed the OS and ran the scripts as mentioned in the readme.
After the final reboot I see the boot messages and the console on the display, but the keyboard seems to be not responding. The beepy-kbd module is loaded:
[ 9.604187] beepy-kbd 1-001f: input_probe BBQX0KBD Software version: 0x11
[ 9.608168] beepy-kbd 1-001f: input_probe registering input device
[ 9.627556] input: beepy-kbd as /devices/platform/soc/3f804000.i2c/i2c-1/1-001f/input/input0
[ 9.640042] Character device registered: major = 240, minor = 0
What's odd is, that when I press the hang-up button for 3 seconds, the character a
is inputted into the console repeatedly.
New beepberry but despite setting up correctly, the screen only displays static.
please add lora or cc1101 to motherboard
and power, a lot of power
I wanted to blank the screen and disable the keyboard so that I could put it in my pocket. The following script is an example. I just put it in rc.local.
<full path>/handle_side_button.py &
#!/usr/bin/python3
##################
import RPi.GPIO as GPIO
import time
import os
# const's
## button
GPIO_SIDE_BUTTON = 17
BUTTON_PRESSED = 0
BUTTON_RELEASED = True
POLL_TIMEOUT_SECS = 0.1
## display
SCREEN_ON = True
SCREEN_DEV = '/sys/class/graphics/fb1'
KEYBOARD_DEV = '/sys/class/input/input0'
TOUCHPAD_DEV = '/sys/class/input/input1'
CONSOLE_DEV = '/dev/tty1'
SILENCE = ' > /dev/null 2>&1'
## commands, relies on sysfs
### blank the screen
SCREEN_OFF_CMD_1 = 'bash -c "echo 1 > ' + SCREEN_DEV + '/blank"' + SILENCE
### disable
SCREEN_OFF_CMD_2 = 'echo 1 > ' + SCREEN_DEV + '/state'
### disable keyboard
KEYBOARD_DISABLE = 'echo 1 > ' + KEYBOARD_DEV + '/inhibited'
### disable touchpad
TOUCHPAD_DISABLE = 'echo 1 > ' + TOUCHPAD_DEV + '/inhibited'
### show the screen
SCREEN_ON_CMD_1 = 'bash -c "echo 0 > ' + SCREEN_DEV + '/blank"' + SILENCE
### enable
SCREEN_ON_CMD_2 = 'echo 0 > ' + SCREEN_DEV + '/state'
### enable keyboard
KEYBOARD_ENABLE = 'echo 0 > ' + KEYBOARD_DEV + '/inhibited'
### enable touchpad
TOUCHPAD_ENABLE = 'echo 0 > ' + TOUCHPAD_DEV + '/inhibited'
# setup the side button with a pull-up
GPIO.setmode(GPIO.BCM)
GPIO.setup(GPIO_SIDE_BUTTON, GPIO.IN, pull_up_down=GPIO.PUD_UP)
# poll the button
while True:
# wait for a button press
if GPIO.input(GPIO_SIDE_BUTTON) == BUTTON_PRESSED:
# track the release
if BUTTON_RELEASED:
BUTTON_RELEASED = False
# ON to OFF
if SCREEN_ON:
SCREEN_ON = False
os.system(SCREEN_OFF_CMD_1)
os.system(SCREEN_OFF_CMD_2)
os.system(KEYBOARD_DISABLE)
os.system(TOUCHPAD_DISABLE)
# OFF to ON
else:
SCREEN_ON = True
os.system(SCREEN_ON_CMD_1)
os.system(SCREEN_ON_CMD_2)
os.system(KEYBOARD_ENABLE)
os.system(TOUCHPAD_ENABLE)
else:
BUTTON_RELEASED = True
# don't thrash
time.sleep(POLL_TIMEOUT_SECS)
I'm not sure how you'd package it, but it would be neat to integrate a LoRa transceiver in the next version of the board. You could use it to send and receive text like messages using LoRa gateways.
Use cases:
I loved my pebble's ability to tether to my android phone. It would be awesome to do something similar with watchy and beepberry.
The website images of the keyboard are blurred out. What's up with that? Are you changing the keyboard in the next batch?
Also, your certs are invalid. Chrome flags your site.
x@albiorix ๎ฐ ~/tmp ๎ฐ sudo ./beepberry-setup.sh
Enabling I2C, SPI, and Console Auto login...
Updating and installing dependencies...
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package raspberrypi-kernel-headers
Error: Failed to install dependencies.
x@albiorix ๎ฐ ~ ๎ฐ apt policy raspberrypi-kernel-headers
N: Unable to locate package raspberrypi-kernel-headers
Does this mean I have to go back to buster or bullseye?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.