Code Junction
Friday, August 11, 2023
Monday, March 1, 2021
Host personal Jupyter notebook on RPI server
Install
Configure jupyter notebook
Setup Password
Install any additional python packages
Start jupyter notebook
Let's try
- Open browser and enter url http://192.168.1.6:8890/
- Enter password
- Create a notebook directory inside home directory
- Create a notebook = finance
- Create cell and run, add run
from pandas_datareader import data as finance
import matplotlib.pyplot as plt
import pandas as pd
from datetime import datetime, timedelta
endDate = datetime.today()
startDate = endDate - timedelta(days=6)
ticker = "AAPL"
ticker_data = finance.DataReader(ticker,
start=startDate.strftime('%Y-%m-%d'),
end=endDate.strftime('%Y-%m-%d'),
data_source='yahoo')['Close']
ticker_data.plot(title="{ticker} Closing Price".format(ticker = ticker))
References
- https://www.raspberrypi.org/forums/viewtopic.php?t=267204
- https://jupyter-notebook.readthedocs.io/en/stable/public_server.html
- 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. 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
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 runusb_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