question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ValueError: The channel sent is invalid

See original GitHub issue

Hi,

I’m trying to run the example project using a SSD1322 display on a FriendlyCore OS on a NanoPi NEO Air.

Running sudo python examples/sys_info.py -f conf/myconfig.cfg I’m getting an error:

Version: luma.oled 2.3.1 (luma.core 1.5.0)
Display: ssd1322
Interface: spi
Dimensions: 256 x 64
------------------------------------------------------------
Traceback (most recent call last):
  File "examples/sys_info.py", line 111, in <module>
    device = get_device()
  File "/home/pi/luma.examples/examples/demo_opts.py", line 63, in get_device
    device = cmdline.create_device(args)
  File "/usr/local/lib/python2.7/dist-packages/luma/core/cmdline.py", line 178, in create_device
    device = Device(Serial(), **vars(args))
  File "/usr/local/lib/python2.7/dist-packages/luma/core/cmdline.py", line 160, in spi
    gpio=self.gpio or GPIO)
  File "/usr/local/lib/python2.7/dist-packages/luma/core/interface/serial.py", line 255, in __init__
    bitbang.__init__(self, gpio, transfer_size, DC=gpio_DC, RST=gpio_RST)
  File "/usr/local/lib/python2.7/dist-packages/luma/core/interface/serial.py", line 153, in __init__
    self._DC = self._configure(kwargs.get("DC"))
  File "/usr/local/lib/python2.7/dist-packages/luma/core/interface/serial.py", line 164, in _configure
    self._gpio.setup(pin, self._gpio.OUT)
ValueError: The channel sent is invalid on a NanoPi

I have the following config defined:

--display=ssd1322
--interface=spi
--width=256
--height=64
--interface=spi
--spi-bus-speed=16000000
--spi-device=0
--gpio-data-command=201
--gpio-reset=1

I believe the FriendlyARM OS comes with the RPI.GPIO python package preinstalled which should have the right physical/gpio pin mappings. During the luma.examples pip install I was keeping an eye on the install output and have seen no output that would suggest that the RPI.GPIO module was overwritten.

I think I have the wiring set up correctly, using the NHD-2.8-25664UCB2 display.

I wonder what the error message really means and what I could do to debug the problem forward. Any help would be appreciated, thanks.

PS: I did try this on an Armbian OS too (not the FriendlyARM Ubuntu, which doesn’t have the RPi.GPIO module preinstalled, I got a similar error there too, only it said ValueError: The channel sent is invalid on a Raspberry Pi (this makes me believe that the RPI.GPIO library should be working fine?)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
attilagyorffycommented, Feb 18, 2018

@thijstriemstra Here you go, this output is a bit meaningless to me but I hope you may be able to shed some light. Thanks in advance.

https://gist.github.com/attilagyorffy/a74c833172b0106781cedcebced03255

0reactions
attilagyorffycommented, Oct 31, 2020

@attilagyorffy did you solve this issue? Im going to close this ticket. Please re-open if you need further assistance To be honest I gave up on the project and don’t remember honestly where I’ve left it off, sorry and thanks anyway.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ValueError: The channel sent is invalid on a Raspberry Pi
ValueError: The channel sent is invalid on a Raspberry Pi - Controlling GPIO Pin 2 (BOARD) using Python causes Error - Stack Overflow....
Read more >
channel sent is invalid - Raspberry Pi Forums
im using a model B+ raspberry pi and using some of the GPIO pins and am getting the error "channel sent is invalid...
Read more >
What is this error ? - Google Groups
File "alarm.py", line 66, in BuildGPIOList. GPIO.setup(GPIOList[i], GPIO.IN). ValueError: The channel sent is invalid on a Raspberry Pi.
Read more >
Raspberry Pi wiring simple LED
Try reversing the led. The longer lead should be connected to the gpio pin and not ground. Also are you using the correct...
Read more >
How to read the signal from POWER_EN pin - Jetson Nano
... in _channel_to_info_lookup ValueError: Channel POWER_EN is invalid ... you should press the power key for 5 seconds, and it'll sending ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found