PiSupply / PiJuice

Resources for PiJuice HAT for Raspberry Pi - use your Pi Anywhere
https://uk.pi-supply.com/collections/pijuice/products/pijuice-portable-power-raspberry-pi
GNU General Public License v3.0
438 stars 104 forks source link

Use PiJuice together with HyperPixel4 display #217

Closed HKHH closed 5 years ago

HKHH commented 6 years ago

Hello, I want to use PiJuice together with the HyperPixel4 display. To the Touch Display I got the following statement: HyperPixel does not use BCM2 and BCM3 as an i2c bus- they are the V-Sync and H-Sync signals for DPI respectively. See here: https://pinout.xyz/pinout/hyperpixel4 If you want to share an i2c bus with HyperPixel you must reroute your device to BCM10 and BCM11 which is the bus used by the HyperPixel touch controlled, visible on the system as /dev/i2c-3

-> BMC10 (Touch Data) pin number 19 -> BMC11 (Touch Clock) pin number 23

My question: What do I have to enter in the GUI under I2C address1 and I2C address2 (RTC)? The pin number or the BMC number?

shawaj commented 6 years ago

This won't be possible on PiJuice without either some manual soldering or connecting it with jumper wires as it is connected to the normal i2c bus pins. Changing the address won't change the pin connections

tvoverbeek commented 6 years ago

@HKHH you would have to connect BCM10 (pin 19) and BCM11 (pin 23) with jumper wires to pin pin 3 and 5 of the PiJuice and break the pin 3 and 5 connection from the Pijuice to the RPi (but needed by the HyperPixel4). With the hyperpixel driver loaded you are using a software based I2C interface on i2c bus 3. In the PiJuice software you will have to change initialization of the pijuice module from pijuice = PiJuice(1, 0x14) to pijuice = PiJuice(3, 0x14) in pijuice_sys.py, pijuice_gui.py, pijuice_cli.py and pijuice_tray.py.

michaelcassius commented 5 years ago

Fantastic... I just ordered both the Hyperpixel and Pijuice Hat ... To have a compact visual along with having mobility would go hand in hand you'd think right? ... apparently not.

So ... now to decide which of these two component to cancel in the order... arrgh! :persevere: there's always something.

shawaj commented 5 years ago

I don't think hyperpixel uses i2c for the display. I think it uses DPI?

michaelcassius commented 5 years ago

@shawaj Yes it uses DPI, I'm still new to this but I'm pretty good at finding solutions to almost any problem, unfortunately getting the PiJuice and Hyperpixel working together seems impossible without going through a tedious/risky process mentioned by @tvoverbeek earlier.

So far I'm pretty disappointed with Pimoroni Hyperpixel 4.0, considering it's priced higher than most and comes with little to zero compatibility with other hats ...even finding an protective enclosure is a challenge.

After reading that PiJuice stated that Pimoroni was fully supporting it - it's sorta safe to assume that PiJuice would work alongside Pimoroni products.

... well, as they say, "assumption is the mother of all f#*kups"

shawaj commented 5 years ago

Where did you read about Pimoroni fully supporting PiJuice? Not sure I've seen that as they don't sell them

tvoverbeek commented 5 years ago

There is no way the Hyperpixel displays can be compatible with almost any other HAT. DPI for the Hyoerpixel uses almost all GPIO pins except 2. The remaining 2 are used for touch support on an software based I2C bus. If you can hook up the software I2C bus (BCM 10 and BCM 11, pins 19 and 21) to the I2C bus pins on the PiJuice (pins 3 and 5) and adapt the PiJuice software as described earlier you can get the Hyperpixel and the PiJuice to coexist. See also https://www.raspberrypi.org/documentation/hardware/raspberrypi/dpi/ for general info about the DPI interface,

BusterTheFerret commented 5 years ago

Actually I think there is. I recently made a video on youtube building pijuice and hyperpixel together, and ran in to exactly this issue. I used a PICO hack PCB to breakout the pins, so that additional stuff could be connected. I added Wide Input Shim an are able to run my Pi'e on a single 18650 Li-Ion battery and in my car s 12volt system. But, there was this issue with the GPIO's and the adresses. And here's the solution I think:

Source: https://learn.pimoroni.com/tutorial/sandyj/getting-started-with-hyperpixel-4

Using the alternate I2C interface on HyperPixel 4.0 (for advanced users)

HyperPixel 4.0 uses literally all of the GPIO pins on the Raspberry Pi, including the standard I2C pins (BCM 2 and 3), but we've broken out pins BCM 10 and 11 as well as 3V3 power and ground, so that you can use I2C devices at the same time as using your HyperPixel 4.0.

You can use a cable with a 2mm pitch, 4-pin, male JST connector on one end and either bare ends that you can solder to your I2C device, or male DuPont connectors (the sort that you get on male jumper jerky). We'll be selling a cable to do this in the very near future.

The nifty trick to using the alternate I2C interface is to symlink i2c-3 to i2c-1 to fool any I2C devices into talking to the alternate one rather than the standard one. Open a terminal, and type:

Command: # sudo ln -s /dev/i2c-3 /dev/i2c-1

Now any software libraries that use I2C should talk to i2c-3 rather than to i2c-1, meaning that you don't have to meddle with the software libraries themselves.

If you want to undo this, you can simply delete the i2c-1 symlink file by typing in the terminal:

Command: # sudo rm /dev/i2c-1

BusterTheFerret commented 5 years ago

Where did you read about Pimoroni fully supporting PiJuice? Not sure I've seen that as they don't sell them

I think there's a solution.... look beneath

STrRedWolf commented 5 years ago

A good question would be why there are no 3.5"/4" DPI displays instead of using the header?

BusterTheFerret commented 5 years ago

Right... Why is that?

michaelcassius commented 5 years ago

Here's an update ... I had success running both together for an hour, see below, sorry I can't explain more to what went wrong.

Experiment ..

A few months ago, with my limited knowledge of GPIO and Soldering etc, I decided 'what the hell' and ordered a 'Pimoroni Mini Black HAT Hack3r' to experiment stacking the Pimoroni Hyperpixel 4" and the PiJuice in a more form friendly manner.

Result ...

Success! (for one hour)

Caveat ...

Both Raspberry Pi and Hyperpixel 4" fried, (since, neither can boot or power on) but the PiJuice Survived.

Note ...

Only the Hyperpixel and PiJuice were connected via Blackhat with the official Raspberry Pi foundation AC plugged in.

I don't recall if I'd altered the BCM / i2C settings, I had at one point but pretty sure it was all reverted back to default when i connected them.

Conclusion ...

As I live in Australia, a technological backwater, these components take weeks to arrive and cost two to three times higher than what anyone else in the world would pay - so with the instant destruction of these brand new items (aka over $250), my enthusiasm became somewhat curbed.

Hopefully this info can help a little, or assist to prevent a similar situation.

BusterTheFerret commented 5 years ago

Hi,

which Pi????

BusterTheFerret commented 5 years ago

I had a little project building a Pi (3B+) stacking a Hyperpixel4 on top of the PiJuice UPS, using a PICO HAT hacker PCB to breakout the GPIO's so that a Wide Input Shim could be implemented too. This way I can use the Pi'e in a 12 volt system, a car, or charge the Pi'e using a single Li-Ion 18650. It worked! I was a little surprised myself, so it would have been nice if this issue didn't occur. I think it's a little sad, that a screen made for a research/project/development platform is not able to be used with a expensive item like PiJuice is. There's a lot of nice functions to work with, all kind of possibilities I like that. But, not if you are facing issues straight away... First I was informed that it was impossible to do. To have a Hyperpixel4 running along with PiJuice. Knowing that both items where developed by Pimoroni, I had trouble believing this. And as we know know, it should be possible. I just don't have gotten this to work. I worked around the issue, removing HyperPixel4, and then it was possible to install and run the PiJuice-GUI and setup the buttons (a shutdown function would have been very nice default). Then I installed Hyperpixel4 again, and then the PiJuice.GUI didn't work any more, but the UPS functions worked. What I think is the worst fact in this issue, is that these 4 items, I used in my project, are all developed by Pimoroni. Why aren't these compatible? Default...

https://shop.pimoroni.com/products/hyperpixel-4 https://uk.pi-supply.com/products/pijuice-standard https://shop.pimoroni.com/products/wide-input-shim https://shop.pimoroni.com/products/pico-hat-hacker?variant=44144542154&currency=GBP&utm_source=google&utm_medium=cpc&utm_campaign=google+shopping

I tried the method that I linked to in my reply above, but no luck. If any of you guys have had the luck or the skills and solved this, please let me know. ;)

KR Dan

STrRedWolf commented 5 years ago

If I remember correctly, the Hyperpixel 4 takes ALL the pins, including all the I2C pins... but there's an I2C port there. If the PiJuice can be switched to use the Hyperpixel 4's I2C port, there we go.

BusterTheFerret commented 5 years ago

By using a symlink???

KR Dan

STrRedWolf commented 5 years ago

Cable from the six-pin header on the Hyperpixel to the PiJuice... but the PiJuice doesn't have an alternate header to plug into.

On Tue, Jun 25, 2019 at 4:56 AM BusterTheFerret notifications@github.com wrote:

By using a symlink???

KR Dan

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

-- Kelly "STrRedWolf" Price http://redwolf.ws

tvoverbeek commented 5 years ago

@BusterTheFerret You wrote

What I think is the worst fact in this issue, is that these 4 items, I used in my project, are all developed by Pimoroni.

Well, the PiJuice is not developed by Pimoroni but by PiSupply. Pimoroni is not even selling the PiJuice.

As you wrote yourself in your April 15 comment, using the i2c-3 (software driven) bus on pins 19 and 23 (BCM10 and 11) and the symbolic link trick should work.

For this to work:

Yes, this is not simple, but the DPI support claims almost all GPIOs including the normal I2C-1

Note: the new Raspberry Pi 4 with BCM2711 SoC has an ALT5 function on BCM10 and 11 for I2C-5

BusterTheFerret commented 5 years ago

Hi,

“Note: the new Raspberry Pi 4 with BCM2711 SoC has an ALT5 function on BCM10 and 11 for I2C-5”

OK, sounds great... But will this do the trick? Or is this a qualified suggestion ;)

Because, I find this issue, unprofessional, for the hightech developer develops a UPS and 2 screens which doesn’t even go along.

Everytime I think of this, my tommy turns..

Dear Lord of Mercy ;)

KR, Dan

ons. 26. jun. 2019 kl. 14.47 skrev Ton van Overbeek < notifications@github.com>:

@BusterTheFerret https://github.com/BusterTheFerret You wrote

What I think is the worst fact in this issue, is that these 4 items, I used in my project, are all developed by Pimoroni.

Well, the PiJuice is not developed by Pimoroni but by PiSupply. Pimoroni is not even selling the PiJuice.

As you wrote yourself in your April 15 comment, using the i2c-3 (software driven) bus on pins 19 and 23 (BCM10 and 11) and the symbolic link trick should work.

For this to work:

  • Install the Hyperpixel software after the PiJuice software since the Hyperpixel software will disable the normal I2C bus.
  • Physically you have to connect the RPI pins 19 (SDA3)and 20 (SCL)3 to GPIO pins 3 (SDA1) and 5 (SCL1) of the PiJuice. Pins 3 and 5 of the RPi may only be connected to the Hyperpixel, not to the PiJuice.
  • Also for the PiJuice to be able to power the system from the battery there has to be a connection from the 5V to the RPi and the Hyperpixel. The 6-pin breakout on the Hyperpixel only has the 3.3V, not the 5V.

Yes, this is not simple, but the DPI support claims almost all GPIOs including the normal I2C-1

Note: the new Raspberry Pi 4 with BCM2711 SoC has an ALT5 function on BCM10 and 11 for I2C-5

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/PiSupply/PiJuice/issues/217?email_source=notifications&email_token=AK6GXMLSTJL6PSFM7OKJ6LTP4NQOFA5CNFSM4FWXBA32YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYTM5AQ#issuecomment-505859714, or mute the thread https://github.com/notifications/unsubscribe-auth/AK6GXMKRYZZQJIF4372YBY3P4NQOFANCNFSM4FWXBA3Q .

--

Med venlig hilsen/Kind Regards

Dan Hansen Elektronik Ingeniør Stud. DTU Tågerupvej 1A, Druestrup 4682 Tureby T.: +45 3071 0903 E.: mail.danhansen@gmail.com


tvoverbeek commented 5 years ago

@BusterTheFerret Dan, You cannot expect that all peripherals with a 40-pin connector can co-exist, especially something like the Hyperpixel4 which claims almost all of the 40 pins. Checking on https://pinout.xyz/ in advance might help. Closing the issue

Det finnss ingenting annat jag kan säga om detta ämne. Med vänliga hälsningar

shawaj commented 4 years ago

For further reference - https://forums.pimoroni.com/t/hyperpixel-4-0-pijuice-hat/11916/3