evilsocket / evilsocket/pwnagotchi

Implementation of a Nokia 5110 LCD - Instructions

Open
#674 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
9.2k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

WhatsApp Image 2019-11-28 at 14 41 09
Introduction:

Target of this post is the implementation of the Nokia 5110 LCD to the pwnagotchi, thereby potentially further lowering cost barrier to entry :P.

You will need the LCD and some jumper wires. You will also require some knowledge of python, code in general and linux.

DO NOT DO ANYTHING WITHOUT UNDERSTANDING IT FIRST.

I am using and testing on a RPi1B+ with a W311M dongle and pwnagotchi v1.3.0.
My Repo: NarenHT/pwnagotchi_nokia5110

Wiring:
Hint: Use Pinout.xyz and mark the base of every 5th pin on the pi

  • Connect DC to GPIO 23
  • Connect RST to GPIO 24
  • Connect DIN to GPIO 10
  • Connect CLK to GPIO 11
  • Connect CS to GPIO 8
  • Connect GND to any ground GND Pins
  • Connect 3V3 to 3V3 PinA or 3V3 PinB
  • optionally Connect LED (the backlight) to 3V3 or GND as per your LCD (see Bugs). Not connecting saves power.

optional If you do not want to use SPI(0,0) see Available SPI and also change nokia5110.py accordingly

Configuration:

  • Step 1
    Initially, follow the instructions provided by pwnagotchi.ai and get ssh to your device.
    Installation Instructions
    Configuration Instructions but keep ui.display disabled in config.yml
    Run sudo apt-get update

  • Step 2
    Run this to download drivers, install and clean up:

cd /home
sudo git clone https://github.com/NarenHT/pwnagotchi_nokia5110.git
cd pwnagotchi_nokia5110
sudo mv nokia5110.py /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/hw/nokia5110.py
sudo mkdir /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/hw/libs/nokia5110
sudo mv nokia5110/* /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/hw/libs/nokia5110
cd ..
sudo rm -r pwnagotchi_nokia5110
  • Step 3
    Run sudo nano /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/display.py and add appropriately after similar statements for other displays
def is_nokia5110(self):
        return self._implementation.name == 'nokia5110'
  • Step 4
    Run sudo nano /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/hw/__init__.py and add appropriately
    from pwnagotchi.ui.hw.nokia5110 import Nokia5110
    AND (Maybe depreciated??)
    elif config['ui']['display']['type'] == 'nokia5110':
        return Nokia5110(config)

  • Step 5
    Run sudo nano /usr/local/lib/python3.7/dist-packages/pwnagotchi/utils.py and add appropriately
    elif config['ui']['display']['type'] in ('nokia5110',):
        config['ui']['display']['type'] = 'nokia5110'
  • Step 6
    Run sudo nano /etc/pwnagotchi/config.yml and add
ui:
    fps: 1.0
    display:
        enabled: true
        type: 'nokia5110'
        color: 'black'
  • Step 7
    Finally, restart the device sudo reboot
    Your LCD should display something now.

  • Step 8 (Advanced UI Tweaks and Work in Progress)
    The 84x48 requires further tweaks to UI to actually make anything legible. In general make stuff shorter in some messages.
    See Reference UI for reference
    Firstly, change all fonts to 8 in sudo nano /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/fonts.py
    More mainly in /usr/local/lib/python3.7/dist-packages/pwnagotchi/voice.py and /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/view.py
    Reboot again.

Known Bugs:

  • LCD backlight: Some backlights require 3V3, while some require GND. Check your LCD before wiring.
  • LCD turns off after a while: Reinitiation, reboot or consider a higher bias value in nokia5110.py (Recommend min 4) to fix the issue.
  • No route to host/no internet: sudo route add default gw <gateway ip here>

Please post here or on Slack for more help.

Disclaimer:
I take no responsibility for your actions. Libraries belong to Adafruit and associates. Untested for Pi0 :P

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the external nokia5110.py implementation and the referenced display.py, ui/hw/init.py, utils.py, fonts.py, voice.py, view.py, and config.yml paths. First verify the existing display integration points, then test the documented wiring and configuration on the stated Raspberry Pi setup; done means a Nokia 5110 can be selected and display a usable UI.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, python, raspberry-pi
Domain
documentation, embedded-iot
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.