Skip to content

Instantly share code, notes, and snippets.

View ansarid's full-sized avatar

Daniyal Ansari ansarid

  • Texas A&M Engineering Experiment Station
  • College Station, Texas
View GitHub Profile
@ansarid
ansarid / .asoundrc
Created November 25, 2019 16:29
Fix TTS Sound on BeagleBone Blue for RemoTV
pcm.!default {
type plug
slave {
pcm "hw:1,0"
}
}
ctl.!default {
type hw
card 1
}
@ansarid
ansarid / wifi_enterprise.sh
Created November 24, 2019 20:25
Connect Beaglebone to Enterprise WiFi
#!/bin/bash
reset
#Promt for root password
[ "$UID" -eq 0 ] || exec sudo bash "$0" "$@"
wifi=()
until ((${#wifi[@]} > 0)); do
@ansarid
ansarid / README.md
Last active October 30, 2019 16:20
Programming GPIO on the BeagleBone Blue

Controlling GPIO on the Beaglebone Blue.

Intro

  1. Start by installing the Adafruit_BBIO library.
sudo apt-get update
sudo apt-get install build-essential python-dev python-setuptools python-pip python-smbus -y
sudo pip3 install Adafruit_BBIO
@ansarid
ansarid / README.md
Last active March 4, 2022 14:22
Reading the BeagleBone Blue MPU-9250 Compass

1. Install the RTIMU Python Library.

git clone https://github.com/RPi-Distro/RTIMULib
cd RTIMULib/Linux/python
sudo python3 setup.py install

2. Compile calibration code.

cd ../RTIMULibCal/
@ansarid
ansarid / hebi_beaglebone_instructions.md
Last active September 23, 2019 18:22
Setup Beaglebone with HEBI
  1. Set the IP of HEBI module to 10.10.10.2 and the subnet mask to 255.255.255.0 using the HEBI Scope software.

  2. Plug the HEBI module into Beaglebone using a USB to Ethernet adapter.

  3. Set Beaglebone ethernet IP to 10.10.10.1 and the subnet address to 255.255.255.0 using the command
    sudo ifconfig eth0 10.10.10.1 netmask 255.255.255.0.

  4. Install HEBI python API using sudo pip3 install hebi-py.

  5. Run python3 01a_lookup.py to get family name and module name.

  6. Run git clone https://github.com/HebiRobotics/hebi-python-examples for hebi-py examples.

@ansarid
ansarid / py_live_db.py
Created September 9, 2019 16:47
Python Heartrate Demo
import heartrate; heartrate.trace(browser=True)
import time
x = 0
while x < 100:
print("Hello World\t", x)
time.sleep(0.1)
x+=1
exit()
@ansarid
ansarid / fix.md
Last active August 26, 2019 06:07
Repair PPTK hand on pptk.view
cd /usr/local/lib/python3.7/dist-packages/pptk/libs
mv libz.so.1 libz.so.1.old
sudo ln -s /lib/x86_64-linux-gnu/libz.so.1

Based off fix at pptk issue #3

@ansarid
ansarid / example.md
Created August 1, 2019 22:04
mjpg_streamer opencv module
sudo apt update
sudo apt install mjpg-streamer-opencv-python

Create filter file. (/home/debian/opencv_filter.py)

import cv2
import numpy as np
@ansarid
ansarid / joystick_serial_packet_assembly.ino
Last active April 13, 2018 05:32
The Joystick Serial Code that Outputs the Proper Packet Format
/*
MATH
Raw Values
int joy_x_axis = nunchuck_buf[0];
int joy_y_axis = nunchuck_buf[1];
#include <SPI.h>
#include <WiFi.h>
char wifi_name[] = "WI-FI DSTR Data";
char wifi_password[] = "dstrdstr";
unsigned int localPort = 3553; // local port to listen on
WiFiUDP Udp;
char packetBuffer[255]; //buffer to hold incoming packet
char ReplyBuffer[] = "acknowledged"; // a string to send back