Skip to content

A smart espresso scale, Powered by the Raspberry Pi Pico W board

License

Notifications You must be signed in to change notification settings

antokara/Smart-Espresso-Scale

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smart Espresso Scale

A Smart Espresso Scale, powered by the Raspberry Pi Pico W board.

components used

  1. Raspberry Pi Pico W board
    1. pinout
    2. I2C Wire doc - pico
    3. I2C Wire doc - arduino
  2. I2C 1602 LCD Display Module 16X2
    1. documentation
    2. arduino lib
    3. arduino example
  3. SparkFun Qwiic Scale - NAU7802
    1. arduino lib TODO: add the rest

VS Code

  1. install VS Code
  2. make sure the Arduino and z-uno extensions are not installed or at least, disabled if installed
  3. install the PlatformIO extension
    1. on Chromebook
      1. sudo apt-get install python3-venv
      2. restart VSCode
      3. warning: it may take up to 10 minutes to finish the installation and all the pio commands to become available
  4. install the teleplot extension
  5. install 99-platformio-udev.rules
    1. curl -fsSL https://raw.githubusercontent.com/platformio/platformio-core/develop/platformio/assets/system/99-platformio-udev.rules | sudo tee /etc/udev/rules.d/99-platformio-udev.rules
    2. on Fedora
      1. sudo udevadm control --reload-rules && sudo udevadm trigger
    3. on Chromebook
      1. sudo service udev restart
    4. on Fedora/Chromebook
      1. sudo usermod -a -G dialout $USER
      2. sudo usermod -a -G plugdev $USER
    5. logout / login to O/S
    6. physically unplug and reconnect your board
      1. on Chromebook
        1. select connect to Linux on chromebook
        2. it should appear as PicoArduino in the Manage USB devices
        3. then, serial monitor can connect
  6. to initialize the project
    1. pio project init
    2. should give Project has been successfully updated!
  7. select the active project environment
    1. >PlatformIO: Switch Project Environment or from the bottom left corner of the IDE
    2. select USB (for first upload) or OTA (for subsequent ones but change the auth inside platformio.ini file)
  8. to build
    1. >PlatformIO: Build or pio run or from the bottom left corner of the IDE
    2. should result in [SUCCESS]
  9. to monitor the serial port for debugging
    1. >PlatformIO: Serial Monitor or from the bottom left corner of the IDE
    2. should open up a new Terminal with the serial monitor
  10. to upload
    1. >PlatformIO: Upload or from the bottom left corner of the IDE
    2. should show progress Loading into Flash: [====] 100% and [SUCCESS]
    3. if not, make sure you have installed the udev rules properly...
    4. warning: Upload over USB is not possible currently on Chromebooks. Therefore, the first upload MUST take place from another O/S (ie. Fedora) and subsequent uploads can happen OTA from Chromebook

hostname

the device should get smart-espresso-scale.local as a hostname on the local network

secrets

copy secrets.h.template to secrets.h and insert values

troubleshooting

unable to upload due to bad firmware

  1. remove the battery
  2. unplug all USB cables
  3. hold the BOOTSEL button and while holding, plug in the PC USB with Power
  4. let go of the BOOTSEL button
  5. confirm mounted media ls /run/media/user/RPI-RP2/
  6. change upload port to /run/media/user/RPI-RP2
  7. upload
  8. change upload port back to auto
  9. turn off USB power
  10. insert battery

debugging

  • in main.cpp uncomment the #define SERIAL_DEBUG and build/upload, to enable serial.print debug messages

clear arduino compile cache

rm /tmp/arduino* -rf

upload through OTA fails

It is not always known why but uploading over WiFi directly to the device, can fail at random % and at random times. The same code and environment settings can fail or succeed just be retrying multiple times.

Restarting the device does not really help.

The most important thing to succeed with OTA updates, is the WiFi signal to be great. Otherwise, it may take up to 10 times/retries to succeed.

references

  1. Arduino-Pico documentation
  2. Arduino-Pico repo

About

A smart espresso scale, Powered by the Raspberry Pi Pico W board

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published