HackerShackOfficial / Smart-Bartender

🍻
MIT License
147 stars 96 forks source link

ImportError: No module named gaugette.ssd1306 #9

Open xelamod opened 6 years ago

xelamod commented 6 years ago

Hello, I'm a beginner with all of this and installed everything cording to the instructions but i'm getting the following error: Traceback (most recent call last): File "bartender.py", line 1, in import gaugette.ssd1306 ImportError: No module named gaugette.ssd1306

what did I missed? thanks!

ddejesu commented 5 years ago

I am having the same issue. if you could please direct us towards a solution it would be great. thanks

Joe2824 commented 5 years ago

Read the README file onece again and execute the setup OLED...

https://github.com/HackerShackOfficial/Smart-Bartender/blob/master/README.md#oled-setup

dexterch commented 5 years ago

I did everything as well but same issue

jbiams77 commented 5 years ago

I am also having the same issue

festermax commented 5 years ago

hi to all!

first of all i hope everybody can apologize me for my englis, second i hope samebody can halp me.

i've make, mounted ed connected all bartender hardware, box, raspberry pi zero HW, trasf, DC-DC regulator, relays, tubes, pirostatic pump, diode and tubes, display and button... all ok, switched on and nothing was explosed!!!! so i think good :-).

for OLED dispaly, i've used : https://www.amazon.it/DollaTek-Pollici-Display-SSD1306-Schermo/dp/B07QJ39RDJ/ref=sr_1_fkmr0_1?__mk_it_IT=%C3%85M%C3%85%C5%BD%C3%95%C3%91&keywords=dollatek+0.96+oled+ssd1306+spi&qid=1575331486&sr=8-1-fkmr0

and used this connections: GND --> Ground (PIN 6) VCC --> 3V3 (PIN 1) D0 --> SPI0_SCLK (PIN 23) D1 --> SPI0_MOSI (PIN 19) RST --> GPIO14 (PIN 8) DC --> GPIO15 (PIN 10)

so all the hardware explaned.

software, (bigggg problems... for me...) rasbian buster lite (no desktop) on raspberry pi zero HW. tryed the guide: https://github.com/HackerShackOfficial/Smart-Bartender bat nothing of the instructions was executed correcty...

First configuration in raspi-config for I2C, SPI and GPIO, WIFI and SSH for shell remote controll.

python -V : Python 2.7.16

"sudo apt install python-pip" : (answer: just installed most new version (18.1-5+rpt1))

"sudo pip install unicornhat" : Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple Requirement already satisfied: unicornhat in /usr/local/lib/python2.7/dist-packa ges (2.2.3) Requirement already satisfied: rpi-ws281x>=3.0.3 in /usr/local/lib/python2.7/dis t-packages (from unicornhat) (4.2.2)

"Enable SPI" : maked

"I2C" : maked

"OLED Setup" :

git clone https://github.com/HackerShackOfficial/Smart-Bartender git clone https://github.com/the-raspberry-pi-guy/oled : Folders created. all two folders in Home/pi/

"sh OLEDinstall.sh" python-pil ???? "python-imaging" no candidates to install. ???? so i'll went to: https://learn.adafruit.com/adafruit-oled-displays-for-raspberry-pi/setting-up

"sudo apt-get install git-core" Note, selected "git" in place of "git-core" git just most recent version (1:2.20.1-2).

"sudo nano /etc/modprobe.d/raspi-blacklist.conf" ok, only text edited.

"sudo nano /etc/modules" ok.

"sudo reboot"

"git clone https://github.com/the-raspberry-pi-guy/OLED" Done!

"cd OLED" Ok.

"sh OLEDinstall.sh" E: Pack "python-imaging" no candidates to install.

Running the Code:

"sudo pip install -r requirements.txt" Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple Requirement already satisfied: RPi.GPIO==0.6.3 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 1)) (0.6.3)

"sudo python bartender.py" Traceback (most recent call last): File "bartender.py", line 1, in import gaugette.ssd1306 ImportError: No module named gaugette.ssd1306

so.. i went on internet about this error : https://forums.adafruit.com/viewtopic.php?f=47&t=76458

and i've used this code: "sudo python setup.py install" python: can't open file 'setup.py': [Errno 2] No such file or directory

"sudo apt-get update" Done.

"sudo apt-get install build-essential python-dev python-pip" build-essential just most recent version (12.6). python-dev just most recent version (2.7.16-1). python-pip just most recent version (18.1-5+rpt1). 0 updated, 0 installed, 0 to remove e 57 not updated.

"sudo pip install spidev" Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple Requirement already satisfied: spidev in /usr/local/lib/python2.7/dist-packages (3.4)

i don't know what i need to do more... this project it was like very simple, bat i'm too stupid... please help me....

Demetrio.

RobbieBakker commented 3 years ago

Hi! I'm having the same issue on the gaugette.ssd1306 module which cannot be found. Any solutions yet?

willchickering commented 3 years ago

Exact same issue. I cannot rabbit hole deep enough to find out why 'ImportError: No module named gaugette.ssd1306' keeps popping up. HELP!!!

rinks1020 commented 3 years ago

did anyone get the solution for "no module named gaugette.ssd1306"

kevinvugts commented 3 years ago

did anyone get the solution for "no module named gaugette.ssd1306"

Nope, and it’s a shame that the owners of this project are not responding at all, despite the fact we pay them a monthly fee on patreon to support more of these projects…..

derelvis commented 3 years ago

Did anyone try to download the gaugette folder from here https://github.com/guyc/py-gaugette/tree/master/gaugette and just put it into the bartender folder? Did not try it as I used another lib for my display. But might work.

kevinvugts commented 3 years ago

@rinks1020 @derelvis @willchickering @RobbieBakker @festermax @ddejesu @dexterch @jbiams77 @xelamod @Joe2824 Hi guys, is there anyone who is still struggling with this issue? I made a complete rewrite from what HackerShack initially wrote back in 2017. I am using the newest libraries right now with support from raspberry pi 3 to the newest version 4.

Let me know in a reply if you're interested in this.

Best Regards, Kevin.

derelvis commented 3 years ago

Hi Kevin, sure, please give it a go! Mine is up and running but it is always interesting to see who others managed to get it working. I extended mine by another 8 buttons to fire drinks by just one button press (8 pumps) and did some other tweaks as well. Did think about creating a fork already but never used git before. ;-) Best Daniel

C-l-a-r-k-y commented 3 years ago

Kevinvugts. I am having all sorts of issues getting the OLED to work. If you have new code with up to date libraries, would you be willing to share them please

kevinvugts commented 2 years ago

Kevinvugts. I am having all sorts of issues getting the OLED to work. If you have new code with up to date libraries, would you be willing to share them please

I got ya. I will upload my code changes to github next week. Will stay in touch.

C-l-a-r-k-y commented 2 years ago

Kevinvugts. I am having all sorts of issues getting the OLED to work. If you have new code with up to date libraries, would you be willing to share them please

I got ya. I will upload my code changes to github next week. Will stay in touch.

Thanks Kevin, Do you know when your code will be available?
Happy to contribute for a fix, issue has had me scratching my head for hours.

C-l-a-r-k-y commented 2 years ago

@kevinvugts - Hi there, appreciate you may not have had a lot of time. Would you be able to upload your code / instructions sometime? Really stuck and need a shove in the right direction. Thanks and hugely appreciate any help

Timesuprise commented 2 years ago

I got this error (see pic)
@kevinvugts if you have a beter one plz sent tis to my im a noob in Python but te hardware is already done :/

image image

huang-chip commented 2 years ago

I find the selution in https://how2electronics.com/interfacing-ssd1306-oled-display-with-raspberry-pi-pico/ As the author's method , I fix this issue in my Pico.

Copy the following code to your editor, Save the code as "ssd1306.py" to your hardware

# MicroPython SSD1306 OLED driver, I2C and SPI interfaces

from micropython import const
import framebuf

# register definitions
SET_CONTRAST = const(0x81)
SET_ENTIRE_ON = const(0xA4)
SET_NORM_INV = const(0xA6)
SET_DISP = const(0xAE)
SET_MEM_ADDR = const(0x20)
SET_COL_ADDR = const(0x21)
SET_PAGE_ADDR = const(0x22)
SET_DISP_START_LINE = const(0x40)
SET_SEG_REMAP = const(0xA0)
SET_MUX_RATIO = const(0xA8)
SET_COM_OUT_DIR = const(0xC0)
SET_DISP_OFFSET = const(0xD3)
SET_COM_PIN_CFG = const(0xDA)
SET_DISP_CLK_DIV = const(0xD5)
SET_PRECHARGE = const(0xD9)
SET_VCOM_DESEL = const(0xDB)
SET_CHARGE_PUMP = const(0x8D)

# Subclassing FrameBuffer provides support for graphics primitives
# http://docs.micropython.org/en/latest/pyboard/library/framebuf.html
class SSD1306(framebuf.FrameBuffer):
    def __init__(self, width, height, external_vcc):
        self.width = width
        self.height = height
        self.external_vcc = external_vcc
        self.pages = self.height // 8
        self.buffer = bytearray(self.pages * self.width)
        super().__init__(self.buffer, self.width, self.height, framebuf.MONO_VLSB)
        self.init_display()

    def init_display(self):
        for cmd in (
            SET_DISP | 0x00,  # off
            # address setting
            SET_MEM_ADDR,
            0x00,  # horizontal
            # resolution and layout
            SET_DISP_START_LINE | 0x00,
            SET_SEG_REMAP | 0x01,  # column addr 127 mapped to SEG0
            SET_MUX_RATIO,
            self.height - 1,
            SET_COM_OUT_DIR | 0x08,  # scan from COM[N] to COM0
            SET_DISP_OFFSET,
            0x00,
            SET_COM_PIN_CFG,
            0x02 if self.width > 2 * self.height else 0x12,
            # timing and driving scheme
            SET_DISP_CLK_DIV,
            0x80,
            SET_PRECHARGE,
            0x22 if self.external_vcc else 0xF1,
            SET_VCOM_DESEL,
            0x30,  # 0.83*Vcc
            # display
            SET_CONTRAST,
            0xFF,  # maximum
            SET_ENTIRE_ON,  # output follows RAM contents
            SET_NORM_INV,  # not inverted
            # charge pump
            SET_CHARGE_PUMP,
            0x10 if self.external_vcc else 0x14,
            SET_DISP | 0x01,
        ):  # on
            self.write_cmd(cmd)
        self.fill(0)
        self.show()

    def poweroff(self):
        self.write_cmd(SET_DISP | 0x00)

    def poweron(self):
        self.write_cmd(SET_DISP | 0x01)

    def contrast(self, contrast):
        self.write_cmd(SET_CONTRAST)
        self.write_cmd(contrast)

    def invert(self, invert):
        self.write_cmd(SET_NORM_INV | (invert & 1))

    def show(self):
        x0 = 0
        x1 = self.width - 1
        if self.width == 64:
            # displays with width of 64 pixels are shifted by 32
            x0 += 32
            x1 += 32
        self.write_cmd(SET_COL_ADDR)
        self.write_cmd(x0)
        self.write_cmd(x1)
        self.write_cmd(SET_PAGE_ADDR)
        self.write_cmd(0)
        self.write_cmd(self.pages - 1)
        self.write_data(self.buffer)

class SSD1306_I2C(SSD1306):
    def __init__(self, width, height, i2c, addr=0x3C, external_vcc=False):
        self.i2c = i2c
        self.addr = addr
        self.temp = bytearray(2)
        self.write_list = [b"\x40", None]  # Co=0, D/C#=1
        super().__init__(width, height, external_vcc)

    def write_cmd(self, cmd):
        self.temp[0] = 0x80  # Co=1, D/C#=0
        self.temp[1] = cmd
        self.i2c.writeto(self.addr, self.temp)

    def write_data(self, buf):
        self.write_list[1] = buf
        self.i2c.writevto(self.addr, self.write_list)

class SSD1306_SPI(SSD1306):
    def __init__(self, width, height, spi, dc, res, cs, external_vcc=False):
        self.rate = 10 * 1024 * 1024
        dc.init(dc.OUT, value=0)
        res.init(res.OUT, value=0)
        cs.init(cs.OUT, value=1)
        self.spi = spi
        self.dc = dc
        self.res = res
        self.cs = cs
        import time

        self.res(1)
        time.sleep_ms(1)
        self.res(0)
        time.sleep_ms(10)
        self.res(1)
        super().__init__(width, height, external_vcc)

    def write_cmd(self, cmd):
        self.spi.init(baudrate=self.rate, polarity=0, phase=0)
        self.cs(1)
        self.dc(0)
        self.cs(0)
        self.spi.write(bytearray([cmd]))
        self.cs(1)

    def write_data(self, buf):
        self.spi.init(baudrate=self.rate, polarity=0, phase=0)
        self.cs(1)
        self.dc(1)
        self.cs(0)
        self.spi.write(buf)
        self.cs(1)

Trust me, It's worked!!

kevinvugts commented 2 years ago

I got this error (see pic) @kevinvugts if you have a beter one plz sent tis to my im a noob in Python but te hardware is already done :/

image image

Hi,

I feel sorry I haven't got back to this. The code runs on my raspberry pi, but I have to look for it since I pretty must lost him haha.

I will get back to you a.s.a.p. In the mean time, did you make any progress?

Best Regards,

huang-chip commented 2 years ago

@kevinvugts image Maybe you can take a look at the bottom right corner of my Thonny editor, I don't think your hardware has been flashed? image Please select this in the lower right corner to try again

huang-chip commented 2 years ago

@kevinvugts I write a blog for your to flash your pico, check it out~

1. Thonny installation

Please go to [Thonny Official Website]( https://thonny.org/ )to finish downloading

*Please refer to *:

[Thonny Installation Tutorial - From_SCDN]( https://blog.csdn.net/qq_29523945/article/details/122757970 )

2. Installation of Raspberry Pie Pico MicroPython

  1. Open Thonny, and there is no "MicroPython (Raspberry Pi Pico). COM5" option in the lower right corner

  2. Connect Raspberry Pi Pico with USB, and something similar to a USB flash disk will pop up on the computer

If it does not appear, press and hold the BOOTSEL button for a few seconds

  1. At this time, a prompt box will pop up in the lower right corner of Thonny, suggesting that we install the development environment for firmware (do not click)**

  2. Click the USB flash drive that just popped up. There is an html file in it. Click in and select microython. Go in and find doenload uf2

  3. Put the uf2 file you just downloaded into the U disk directory, and the hardware will no longer be recognized as a U disk.

  4. Please re plug the USB and select "MicroPython (Raspberry Pi Pico). COM5" as the interpreter in the lower right corner of Thonny

Please ensure that your interpreter is no longer your local python Exe, you must use MicroPython to drive the hardware

3. Congratulations on completing your first Flash job. Try the lighting program!


from machine import Pin

#The above sentence is to find all the pins in the raspberry pie bag

led=Pin(25,Pin.OUT)

#Control the element (LED) light of the 25 port as an output component

# Pin. OUT is used for output and Pin. IN is used for input

while True:

Led. value (1) # Give LED a high level

Print ("useful baa, useful baa~")
kevinvugts commented 2 years ago

@kevinvugts I write a blog for your to flash your pico, check it out~

1. Thonny installation

Please go to [Thonny Official Website]( https://thonny.org/ )to finish downloading

*Please refer to *:

[Thonny Installation Tutorial - From_SCDN]( https://blog.csdn.net/qq_29523945/article/details/122757970 )

2. Installation of Raspberry Pie Pico MicroPython

  1. Open Thonny, and there is no "MicroPython (Raspberry Pi Pico). COM5" option in the lower right corner
  2. Connect Raspberry Pi Pico with USB, and something similar to a USB flash disk will pop up on the computer

If it does not appear, press and hold the BOOTSEL button for a few seconds

  1. At this time, a prompt box will pop up in the lower right corner of Thonny, suggesting that we install the development environment for firmware (do not click)**
  2. Click the USB flash drive that just popped up. There is an html file in it. Click in and select microython. Go in and find doenload uf2
  3. Put the uf2 file you just downloaded into the U disk directory, and the hardware will no longer be recognized as a U disk.
  4. Please re plug the USB and select "MicroPython (Raspberry Pi Pico). COM5" as the interpreter in the lower right corner of Thonny

Please ensure that your interpreter is no longer your local python Exe, you must use MicroPython to drive the hardware

3. Congratulations on completing your first Flash job. Try the lighting program!

from machine import Pin

#The above sentence is to find all the pins in the raspberry pie bag

led=Pin(25,Pin.OUT)

#Control the element (LED) light of the 25 port as an output component

# Pin. OUT is used for output and Pin. IN is used for input

while True:

Led. value (1) # Give LED a high level

Print ("useful baa, useful baa~")

No need for a blog post for me. I finished this project ages ago with my own code. Thanks anyways!