I suggest creating more categories for this forum to help users filter/find conversations relevant to their interests.
Suggestions:
- Troubleshooting (ask for help)
- Releases (Onion build info/release notes)
- Python
- NodeJS
- IoT
I suggest creating more categories for this forum to help users filter/find conversations relevant to their interests.
Suggestions:
Hooray for CPU! ...driving from Omega2+ direct is so much better than going via the Arduino.
@luz thanks! Seems to work ok so far
Here's a summary for those playing at home...
wget http://plan44.ch/downloads/experimental/kmod-p44-ledchain_4.4.61%2B0.9-2_mipsel_24kc.ipk
opkg install --force-depends kmod-p44-ledchain*
omega2-ctrl gpiomux set pwm0 pwm
insmod /lib/modules/4.4.61/p44-ledchain.ko ledchain0=0,300,2
echo -en '\xFF\x00\x00\x00\xFF\x00\x00\x00\xFF\xFF\xFF\xFF' >/dev/ledchain0
Neopixels DI, GND connected to Omega2+ Pin 18 and GND (on dock).
For 300 x WS2812B pixels .. "ledchain0=0,300,2" .. ledtype 2 seems to work better than ledtype 1
^^ OP updated.
So, issues encountered while figuring all this out were...
The neopixel-tool package is not available on the Omega2+ repo, as suggested by the documentation ??
Often, you have to press the MCU RESET switch on the ArduinoDock2 to ensure the Arduino Library is running on the Arduino side, before you execute your python on the Omega2+ side.
Which unfortunately is not a reliable solution. Is there a way in Python to force the Arduino side to re-initialise ??
e.g.
npixel = neopixel.OnionNeopixel(6, 256)
Fails quite spectacularly.
Hello,
See here for a basic test of Omega2+ and Arduino Dock 2 with NeoPixels using python.
...
From the beginning...
wifisetup
(Omega2+ with ArduinoDock2 via WiFi)
oupgrade -f
opkg update opkg install arduino-dock-2
.
*** This is missing from the online documentation ***
You need to add "Onion Arduino Library" to your IDE, include it in some Arduino script and write it to the ArduinoDock2. Technically, you could do this without WiFi using the basic Dock and COM3.
Add "Onion Arduino Library" in Arduino IDE
Menu: Sketch > Include Library > Library Manager.
.ino code to write to Dock.
#include <OnionLibrary.h> Onion* onionSetup; void setup() { // put your setup code here, to run once: onionSetup = new Onion(); } void loop() { // put your mum here, to run repeatedly: }
opkg update opkg install pyNeopixel python-light
This page refers to the Arduino Dock 1 ... (?)
https://wiki.onion.io/Documentation/Libraries/Arduino-Dock-Neopixel-Library
(The Example Code at the bottom of page - link is dead)
from OmegaArduinoDock import neopixel
import time
import math
npixel = neopixel.OnionNeopixel(6, 255, 0x08)
status = npixel.setBrightness(32)
count = 0
while True:
print "Pixel #" + str(count)
status = npixel.setPixel(count, 0x80, 0x00, 0x00)
status = npixel.setPixel(count+1, 0xff, 0xff, 0xff)
status = npixel.showPixels()
count = count +1
time.sleep(0.03)
Returns...
Setting pin to 6
Setting strip length to 255
Setting brightness to 32
Pixel #0
Pixel #1
Pixel #2
Pixel #3
...
Success.
I suggest creating more categories for this forum to help users filter/find conversations relevant to their interests.
Suggestions: