/dev/spidev0,0 on the Rock64 - Does anyone know how to enable it? - Printable Version +- PINE64 (https://forum.pine64.org) +-- Forum: ROCK64 (https://forum.pine64.org/forumdisplay.php?fid=85) +--- Forum: Linux on Rock64 (https://forum.pine64.org/forumdisplay.php?fid=88) +--- Thread: /dev/spidev0,0 on the Rock64 - Does anyone know how to enable it? (/showthread.php?tid=6282) Pages:
1
2
|
/dev/spidev0,0 on the Rock64 - Does anyone know how to enable it? - Kappuchino - 07-14-2018 How can a user enable /dev/spidev0,0 on Rock64? I've seen this very topic discussed and most of the threads / replies are vague, outdated or not working. I would appreciate a "put this into this file" or "run this command" pointer. Or an article I have not found(yet) - see the ones that didn't help (me) below. Current os (uname -a) is Linux rock64 4.4.126-rockchip-ayufan-239 aarch64 GNU/Linux . Question aims at making python demo code of Waveshare ePaper (like https://www.waveshare.com/wiki/E-Paper_Driver_HAT) work with Rock64 - no, not in hat mode, in cable mode. Already took different python lib (with RPi.GPIO-PineA64) into account as well as different Pinout. Current Error is: File "/root/code-red/python/epdif.py", line 43, in SPI = spidev.SpiDev(0, 0) FileNotFoundError: [Errno 2] No such file or directory This should go away with spidev0,0 present in /dev and then ... I'll fix the next problem. I think it might be just a command similar to "enable_dtoverlay i2c0 i2c@ff150000 okay" but I have not figured out what the magic words are. Most people point to a few who might know, but ... no dice. Similar unanswered Questions are:
Similar Questions with an answer that does not work (anymore) or are beyond my skills are:
Thank you for any help in advance. Note:
RE: /dev/spidev0,0 on the Rock64 - Does anyone know how to enable it? - Kappuchino - 08-17-2018 It seems that there is no solution except using another distro and experimenting, which will surely create other problems for us around liquid investigations. And even then, I have no idea how it will work. Dammit, is it really so hard to get an 08/15 eInk display run on advanced arm64s except raspberry? So if you come here with the same question about spidev on rock64 as I did, there is no solution until someone tells you specifically otherwise for rock64. Don't search further, because I've asked here, on github, reddit, stack overflow, irc, ... and after more than a month no helpful answers, just redirects and complaints about wrong phrasing for the question... Yes, I know everyone works her for free and for their own purpose. So do I: Spent half a year lobbying to give this platform a chance for a project supposed to help investigative journalists around the globe which otherwise would just run on intel as everything else. Occam's razor tells me this is a chicken and egg problem: The hardware seems to be missing use cases which causes a lack of knowledge how to use the hardware. If you want to just run eInk displays or anything ales, go the way of the raspberry pi.So I have to wait till raspberry pi finally gets to 2 or 4 gb and usb 3 since that was that is the critical demand for li. RE: /dev/spidev0,0 on the Rock64 - Does anyone know how to enable it? - mcerveny - 08-17-2018 SPI with user programs (python) for Rock64:
Demo code is attached. Happy hacking and buy me a Beer. RE: /dev/spidev0,0 on the Rock64 - Does anyone know how to enable it? - Kappuchino - 08-18-2018 Kinda offline & at my parents this weekend, so I can't test. But I sent 2 beers via my mums paypal. She also says "Enjoy!". RE: /dev/spidev0,0 on the Rock64 - Does anyone know how to enable it? - Kappuchino - 08-21-2018 I'm having trouble recreating your steps. # uname -a Linux rock64 4.4.132-1075-rockchip-ayufan-ga83beded8524 #1 SMP Thu Jul 26 08:22:22 UTC 2018 aarch64 aarch64 aarch64 GNU/Linux # cat >spi1.dts <<EOF [...] [did that, worked] # dtc spi1.dts -o spi1.dtbo Warnings: spi1.dtbo: Warning (unit_address_vs_reg): Node /fragment@0 has a unit name, but no reg property spi1.dtbo: Warning (pci_device_reg): Failed prerequisite 'reg_format' spi1.dtbo: Warning (pci_device_bus_num): Failed prerequisite 'reg_format' spi1.dtbo: Warning (simple_bus_reg): Failed prerequisite 'reg_format' spi1.dtbo: Warning (avoid_default_addr_size): Relying on default #address-cells value for /fragment@0/__overlay__/spidev@1 spi1.dtbo: Warning (avoid_default_addr_size): Relying on default #size-cells value for /fragment@0/__overlay__/spidev@1 # mkdir /sys/kernel/config/device-tree/overlays/spi1 [okay, did that with sudo, wrong?] # cat spi1.dtbo > /sys/kernel/config/device-tree/overlays/spi1/dtbo /sys/kernel/config/device-tree/overlays/spi1/dtbo: Permission denied # ls /dev/spidev* not found so ...
RE: /dev/spidev0,0 on the Rock64 - Does anyone know how to enable it? - mcerveny - 08-21-2018 Weird. I repeated steps again (using the same kernel 4.4.132-1075-rockchip-ayufan-ga83beded8524) with success.
Every eink module have own demo. Let's choose 1.54" and demo. Connect SPI device pinheader Pi-2 Bus:
And demo the demo (under root) but untested: Code: # ls /dev/spidev* RE: /dev/spidev0,0 on the Rock64 - Does anyone know how to enable it? - Kappuchino - 08-22-2018 It worked (getting spidev ...) ... but how ... well: I noticed there are two bionic versions bionic-minimal-rock64-0.7.9-1067-arm64.img and bionic-minimal-rock64-0.7.9-1067-armhf.img. I just used the other one and got an even stranger error for using dtc. So I looked up the solution for that (didn't want to flash the sd again ..., curious ...): https://github.com/beagleboard/bb.org-overlays/blob/master/dtc-overlay.sh Ran the script. Worked. Ran your commands. Worked. And now ... # udevadm info --query=all --name=spidev32766.1 P: /devices/platform/ff190000.spi/spi_master/spi32766/spi32766.1/spidev/spidev32766.1 N: spidev32766.1 E: DEVNAME=/dev/spidev32766.1 E: DEVPATH=/devices/platform/ff190000.spi/spi_master/spi32766/spi32766.1/spidev/spidev32766.1 E: MAJOR=153 E: MINOR=0 E: SUBSYSTEM=spidev YESSS! Thank you. Thank you. Thank you. Next step: Getting that display to run. Will write detailed setup/how-to when done. RE: /dev/spidev0,0 on the Rock64 - Does anyone know how to enable it? - Kappuchino - 08-22-2018 Got that fixed by just redoing everything and then ... it just worked up till here. Now ... Now this happens: # pip install spidev Collecting spidev Downloading https://files.pythonhosted.org/packages/36/83/73748b6e1819b57d8e1df8090200195cdae33aaa22a49a91ded16785eedd/spidev-3.2.tar.gz Building wheels for collected packages: spidev Running setup.py bdist_wheel for spidev ... error Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-61F19v/spidev/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmptbr3Elpip-wheel- --python-tag cp27: usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] or: -c --help [cmd1 cmd2 ...] or: -c --help-commands or: -c cmd --help error: invalid command 'bdist_wheel' ---------------------------------------- Failed building wheel for spidev Running setup.py clean for spidev Failed to build spidev Installing collected packages: spidev Running setup.py install for spidev ... done Successfully installed spidev-3.2 (?!?) When I start main.py, it doesn't complain, but nothing shows on the display ... (DM me, my offer still stands to send you an gratis ePaper Display + Beer) RE: /dev/spidev0,0 on the Rock64 - Does anyone know how to enable it? - mcerveny - 08-22-2018 (08-22-2018, 12:22 PM)Kappuchino Wrote: # pip install spidevFirst must be ensure that "spidev" is working. Code: # pip uninstall spidev I will try to check/modify specific version of demo code. (I am running image "bionic-lxde-rock64-0.7.9-1067-arm64.img") RE: /dev/spidev0,0 on the Rock64 - Does anyone know how to enable it? - Kappuchino - 09-08-2018 (Sorry for the wait, took a break from computing and else) So now everything is smooth until I start the modified script then ... nothing. Here is the "proof of wireing" - this time with a 4.2'' display, but others didn't work as well. When I force-quit with ctrl-c, this is the output: ^C You must setup() the GPIO channel (BOARD 26) as an output first ^C You must setup() the GPIO channel (BOARD 15) as an output first ^C Traceback (most recent call last): File "main.py", line 84, in <module> main() File "main.py", line 80, in main epd.set_frame_memory(time_image.rotate(90), 80, 80) File "/home/rock64/spidev/epd1in54.py", line 205, in set_frame_memory self.send_data(byte_to_send) File "/home/rock64/spidev/epd1in54.py", line 97, in send_data self.digital_write(self.dc_pin, GPIO.HIGH) File "/home/rock64/spidev/epd1in54.py", line 82, in digital_write epdif.epd_digital_write(pin, value) File "/home/rock64/spidev/epdif.py", line 41, in epd_digital_write GPIO.output(pin, value) File "/home/rock64/spidev/R64/_GPIO.py", line 184, in output for index in range(len(channel)): KeyboardInterrupt So ... I will write down line by line what I did, again (see that on github today) but no dice so far. |