Showing posts with label raspberry pi. Show all posts
Showing posts with label raspberry pi. Show all posts

Wednesday, August 3, 2022

RASPBERRY PI: Compiling kernel for long BLE advertising timings

just follow this for the compiling process :

https://www.raspberrypi.com/documentation/computers/linux_kernel.html

before compiling the kernel open include/net/bluetooth/hci.h with any text editor and find this line

then replace it with

Tuesday, July 12, 2022

pyenv installation for raspberry pi (Bullseye)

Let start by installing all the necessary libraries.
sudo apt install -y git openssl libssl-dev \
    libbz2-dev libreadline-dev libsqlite3-dev \
    libffi-dev liblzma-dev
use pyenv-installer script to make our live a lil' bit easier.
curl https://pyenv.run | bash
edit your ~/.bashrc, add this 3 lines at the end of the file. what it does? this 3 lines is going to add pyenv executable to the environment PATH of the shell session and to enable autocomplete function

restart the shell session by reopening the terminal session or reload the session using this command
source ~/.bashrc

install any python version you wanted, use this command to list all available python versions

pyenv install -l
 i.e. installing python version 3.10.
pyenv install 3.10.5
it's always a good idea to create individual venv for each of your projects, i.e. making a venv named project1 based of python 3.10.5
pyenv virtualenv 3.10.5 project1
activate the venv for this shell session
pyenv shell project1
to confirm which version of the venv currently active
pyenv version
you can make the shell automagically enabled for when changing directory to specific projects folder.
cd ~/project_folder
pyenv local project1
or just enable it globally
pyenv global project1