Skip to content

Instantly share code, notes, and snippets.

#define debug 0
#define deadband 50
#define nchannels 4
typedef struct{
int16_t steer;
int16_t speed;
} Serialcommand;
volatile Serialcommand command;
@jpfree
jpfree / mqtt-full.sh
Created February 4, 2024 07:34 — forked from gtxaspec/mqtt-full.sh
mqtt + openipc example
#!/bin/sh
# MQTT Broker settings
BROKER="193.169.2.1"
PORT=1883
USERNAME="openipc"
PASSWORD="brokerpass"
SUB_TOPIC="camera/$1/#"
MOTOR_BINARY="ingenic-motor"
MQTT_BINARY="mosquitto_sub"
@jpfree
jpfree / check_connection
Created September 5, 2023 04:18 — forked from gardner/check_connection
OpenWrt cron job to check the connection and, if there is no connection, reboot the Huawei E3272 modem using the hilink api.
#!/bin/ash
# OpenWrt cron job to check the connection and, if there is no connection,
# reboot the Huawei E3272 modem using the hilink api. This script is optimized
# for busybox and written in ash.
# Put this script in /bin/check_connection and then: chmod +x /bin/check_connection
# Then: crontab -e
# */15 * * * * /bin/check_connection > /tmp/reboot_con.log 2>&1
f="/tmp/reboot_lock"
if [ ! -f "$f" ]; then
#!/bin/bash
#
# Binary file compiler.
# Creates a file for programming onto a flash chip.
#
# Example:
# ./compile4programmer.sh stock-uboot.bin uImage.t31 rootfs.squashfs.t31 8
#
# Running this command will produce a new binary file
# full4programmer-8MB.bin or full4programmer-16MB.bin
@jpfree
jpfree / arduinoPPM.ino
Created November 8, 2022 02:39 — forked from rinozen/arduinoPPM.ino
Arduino 8Ch PPM Decoder with Smoothing and Connection Status
unsigned long int ft, lt, x, tfail;
int ch, chx[9][13];
const int idx = 10;
const int total = 11;
const int val = 12;
void setup() {
Serial.begin(9600);
ft=0; lt=0; x=0; tfail=0; ch=0;
@jpfree
jpfree / send-gv-msg.py
Created February 20, 2019 03:22 — forked from Ansen/send-gv-msg.py
python27 send google voice msg.
from six.moves import input
# Need to install googlevoice
# pip install googlevoice
from googlevoice import Voice
def run():
username = "zxcv@gmail.com"
pwd = "123456"
voice = Voice()
voice.login(email=username, passwd=pwd)
@jpfree
jpfree / rw-rootfs
Created February 1, 2019 01:51 — forked from DennisLfromGA/rw-rootfs
A script that asks to make the root filesystem read-writable for subsequent changes and additions by the user.
#!/bin/sh -e
##!! PLEASE USE THIS SCRIPT WITH CAUTION - AND AT YOUR OWN RISK !!##
##!! IT HAS BEEN KNOWN TO CAUSE RESETS AND WIPE DATA ON SOME CHROMEBOXES !!##
APPLICATION="${0##*/}"
ANSWER=''
SUDO=''
USAGE="
$APPLICATION [no options]