Monday, March 1, 2021

Host personal Jupyter notebook on RPI server

Install


sudo apt-get install python3-numpy python3-pandas python3-matplotlib
sudo apt-get install jupyter-notebook

Configure jupyter notebook


jupyter-notebook --generate-config

c.NotebookApp.ip = '192.168.1.6'
c.NotebookApp.port = 8890
c.NotebookApp.allow_remote_access = True
c.NotebookApp.open_browser = False

Setup Password


jupyter notebook password

Install any additional python packages

pip install panda-datareader

Start jupyter notebook


jupyter notebook

Let's try

  1. Open browser and enter url http://192.168.1.6:8890/ 
  2. Enter password
  3. Create a notebook directory inside home directory
  4. Create a notebook = finance
  5. Create cell and run, add run


References

  1. https://www.raspberrypi.org/forums/viewtopic.php?t=267204
  2. https://jupyter-notebook.readthedocs.io/en/stable/public_server.html
  3. https://riptutorial.com/pandas/example/6232/datareader-basic-example--yahoo-finance-

Sunday, January 10, 2021

Programming ESP8266 in Arduino IDE

ESP8266 are cheap Wi-Fi modules with wide variety of support for rapid development and the best part these module support programming using most popular IOT IDE - Arduino. This blog post is for beginner who as just started or looking to start programming with ESP8266 module.

I recently bought ESP8266 ESP-12F development board from Amazon https://www.amazon.com/gp/product/B076F52NQD. This kind of board has microusb to easily power and flash sketch to the board but the board usually uses cheap USB to serial module CH240g. It is little bit of tricky to install CH240g drivers on Windows10 because there are no default driver available for CH240g although CH240g has better driver support for linux OS. Follow below steps to setup your on windows 10

1. Download and run it to install drivers for 

CH240g. https://cdn.sparkfun.com/assets/learn_tutorials/8/4/4/CH341SER.EXE


2. After successful installation connect your PC with board using a micro-usb cable then open Device Manager and under ports make sure that you see USB-SERIAL CH340. 

2. Download and install Arduino IDE from windows store.

3. Goto File -> Preferences and add ESP8266 board manager urls in Adurino. 


4. Goto Tools -> Board Managersinstall esp8266 boards packages 


5. Now select Board







Sunday, June 28, 2020

Listen to HD Radio using RTL-SDR


Radio station in north america broadcasts HD radio signals. HD radio signal can be seen in below frequency spectrum of 102.7 MHz channel. The 2 rectangle shaped band on both side of analog radio signal are Lower and upped side band respectively of HD Radio signals. NRSC-5 is standard protocol to transmit HD radio signal. 


To receive and nrsc-5 radio, i have cross compiled (win64) nsrc program on pi using below commands
sudo apt install git build-essential cmake autoconf libtool libao-dev libfftw3-dev librtlsdr-dev
cd ~/dev/
git clone https://github.com/theori-io/nrsc5.git
cd nrsc5 
sudo apt install mingw-w64
support/win-cross-compile 64
Copy libnrsc5.dll and nrsc5.exe to windows and run

nrsc5.exe 102.7 0

if you get below error, stop any other which is using SDR device like SDRSharp and run it again.
usb_open error -3
Please fix the device permissions, e.g. by installing the udev rules file rtl-sdr.rules

References 
1. NRSC-5 https://www.nrscstandards.org/standards-and-guidelines/documents/standards/nrsc-5-d/nrsc-5-d.asp
2. nrsc github - https://github.com/theori-io/nrsc5