I have bought a 32 led strip and I'd like to connect and control it with my raspberry PI mod. B.
I am using the root user, I have /dev/spidev0.0 device, all the connections are right, I use a dual power supply with common GND.
I am testing with https://github.com/ManiacalLabs/BiblioPixel with LPD8806 driver.
I cannot succeed to control any of the led. Some of them are turned on but I have no control over them.
My wire setup is depicted here https://github.com/ManiacalLabs/BiblioPixel/wiki/SPI-Setup
Any advices?
Thank you
Solved!!
The strip has a connector which "suggest" to connect the wires. You have to solder the wires at the other end to make it work!
Bye,
Massimo
Related
I am looking into trying to run ipmitool over I2C and was wondering if this is supported. I have a raspberry Pi connected via I2C to another device that has a BMC. I have the character device /dev/i2c-1 which I can use to write I2C commands to but I am hoping to be able to send IPMI commands instead, such as with ipmitool.
If I connect the Pi and other system both to the same network, I can still send commands over ipmitool's lanplus interface but that is not what I want to do. I would like to see if sending them over I2C is possible.
Most commands I run with ipmitool seem to attempt to open the file /dev/ipmi-N which doesn't exist on my raspberry pi. I checked the driver support in the kernel for getting that (https://www.kernel.org/doc/html/latest/driver-api/ipmi.html) and made sure that my kernel has ipmi_msghandler, ipmi_devintf, and ipmi_ssif compiled into it. But still no luck. I suspect the issue is that I haven't correctly configured the ipmi_ssif driver on the kernel command line. Am I on the right path with this? I determined the i2c address with i2cdetect -y 1 and it shows up as 0x10. Dumping the file cat /sys/class/i2c-adapter/i2c-1/name shows me that my adapter is bcm2835. This led me to try to add ipmb_ssif.addr=0x10 ipmi_ssif.adapter=bcm2835 ipmi_ssif.dbg=1,2,4,8 ipmi_ssif.dbg_probe=1 to the kernel command line. However, I didn't specify anything for ipmi_ssif.slave_addrs, ipmi_ssif.tryacpi, or ipmi_ssif.trydmi which admittedly could be my problem. I don't know if it could also be just something with the raspberry Pi maybe not having some support for this or something. Any ideas?
I also tried the driver ipmi_si, although the Pi doesn't seem to have the hardware support for this. I suspect that's trying to access a BMC locally instead of trying to go over I2C. Since the ipmi_ssif talks about going over an SMBus that seemed like the one that I wanted.
I did also looked through some of the other interfaces that ipmitool supports and went down a bit of a rabbit hole with the ipmb-dev-int driver (https://www.kernel.org/doc/html/latest/driver-api/ipmb.html) since that also looked promising and originally mistook it for imb interface. But it doesn't look like ipmitool has that as an interface. But perhaps there is another one there that might be a better option for what I am trying to do. Maybe the free interface for working with freeipmi?
Any ideas would be greatly appreciated!
I posted a similar question to the folks who maintain ipmitool https://github.com/ipmitool/ipmitool/discussions/296 and one of the maintainers there helped me out by pointing me to another ipmb driver https://github.com/Mellanox/ipmb-host that looks like I might be able to use in combination with the OpenIPMI interface.
I'm trying to establish Modbus RTU connection (for learning purposes) between two PC's (Win10). I'm using two USB to RS485 converters (D- connected together and D+ also connected together). This converters are connected to USB2.0 ports.
USB to RS485 converter
So I'm using "Modbus Poll" and "Modbus Slave" from "modbus tools".
First computer act as slave and has the following settings:
Slave configuration
Slave definition
Second computer act as master and has following settings:
Master configuration
Master definition
And my problem is, everytime i get "Timeout error":
Timeout error
So, what I'm doing wrong? I'm pretty sure converters are not damaged, because Win10 detecs them.
After all I just want to send simple value to another computer (via Modbus RTU) :)
Thanks
Well, this is not a real answer but I can provide some debugging suggestions.
In the past, I had problems with that RS-485 hardware you're using. It didn't work and I'm not sure why. The one I have uses a strange logic to drive DE pin of the MAX485. If I remember correctly, it inverts the TX line coming from CH340G using a NAND gate and feeds it to DE pin. I'm not sure if it was the problem, but I don't think it's a good design.
You may need pull-up and pull-down resistors on RS-485 lines to prevent it from floating when no driver is driving the bus. Some converters include them internally. Also, you may need 120 ohm termination resistors on both ends.
Instead of working with RS-485, you can simply use TTL logic for testing purposes. Use two USB-TTL converters, connect TX to RX (cross connection).
When debugging communication buses (USART, SPI, I2C etc.) always use logic analyzers. Even the cheapest one saves hours of debugging time.
you need to install proper drivers. I used following link which includes a how to video as well as download link for the drivers . Also disable RTS as its 2 wire RS485 so RTS cant be used.
I am making a research about CAN bus, and I need to see how it works. Is there a way to simulate simple CAN bus instructions? What hardware I must have for this purpose?
P.S: I am very new to topic.
To simulate can instructions you don't need any hardware. You can use socketcan under Linux and setup a virtual can-interface.
After you have setup the virtual can-interface vcan0, to try first things install can-utils:
sudo apt install can-utils
Then listen on the virtual can interface vcan0 by executing
candump vcan0
On another terminal send for example a can frame (with identifier 123) with 3 bytes of data 0x123456 to the interface vcan0 via
cansend vcan0 123#123456
You should also see the sent can-frame on the other terminal, where you executed candump vcan0.
In case you really want to "talk" to a real CAN-network you need hardware. One good and cost-effective way, would be to use a Raspberry Pi with a CAN-extension shield. Also there you can use socketcan + can-utils.
My dad wants me to make kind of a smart home.
I would like to interface with KNX (a home automation protocol) using the GPIO on a Raspberry Pi 3. Ideally, I would like to build a web interface for it, but I don't have a clue how to interface with KNX in the first place.
Any suggestions?
It wont make sense for you to interpret and understand the KNX bus communication protocol directly. There is a massive specification behind the KNX bus which deals with so many problems from device addresses to collision detection. It would take years to master it and unless you develop KNX devices you really should not spend your time on it. You will be better off by doing the following:
Buy a KNX/IP gateway/interface such as https://www.mdt.de/en/products/product-detail/system-devices/system-devices/ip-interface.html
Understand that KNX bus traffic can be routed/tunneled to your home LAN/WIFI
Play around with one of the KNX libraries on GitHub. For example for C#: https://github.com/search?l=C%23&q=knx&type=Repositories&utf8=%E2%9C%93
If you want, have a look at my experimental .NET Core project which starts a radio streaming process when someone touches a button (in the bathroom in my case). It runs on any operation system (so Raspberry and Linux are fine) and you can find it here: https://github.com/ThomasZeman/KnxNetCore
check this website : http://michlstechblog.info/blog/raspberry-pi-eibknx-ip-gateway-and-router-with-knxd/ that might help. also there are special knx 2 ip devices sold by electronic stores
You can't connect the KNX bus to anything on the pi. The KNX bus has its own electrical specs, and you need specialized hardware to connect to it.
Such hardware is available, but probably a KNXnet/IP device (such as the Siemens N148) is a better option.
I see two options for you:
A) use an IP interface (e.g. the ones from MDT) and access the IP interface from your raspberryPi (e.g. with http://calimero-project.github.io/)
B) use a TPUART controller, which makes KNX TP telegrams accessible (r/w) to UART - see http://www.konnekting.de/konnekting-lernen/l1-knx-mit-arduino/
We need to do some stress testing of our system, and we would like to be able to simulate non-ideal situations: things like latency, jitter, etc. In particular, we would like to simulate behavior of data over a cellular network.
Do you know of any hardware/software/both solutions that would work?
Thanks
Ideally you would get some idea about parametrization from a real simulator like ns3. Or write one yourself.
Additionally you could use the Linux kernels built-in QoS stack which provides the netem module which can be used for these purposes. netem provides network emulation functionality for testing protocols by emulating the properties of wide area networks. The current version emulates variable delay (jitter), loss, packet corruption, duplication and re-ordering. It supports distribution based opteration or you could script it to change certain values during run time.
Wifi card with an older access point/router, simply take the test station to the edge of the range and you should be able to reliably cause the connection to fail and reconnect. Only reason I sugest an older model is that the range generally weren't that fantastic on the older "802.11b" stuff.
But other than just being a lossy connection, I am not sure you'd be able to use this setup to test certain characteristics of a cellular connection, but it should work.
If you are in the US, an iPhone on AT&T would probably do it..
Probably need something along the lines of:
USRP Board, OpenBTS, TrixBox/Asterisk
You can check out OpenBTS(http://openbts.sourceforge.net/) and see if it will do what you need. You could have it use the USRP board as a tower, then use it similar to a loopback. I do know that the above combination will allow phones to connect to it like a cell tower(See BurningMan/DEFCON 18), so in theory it should allow you to broadcast out to saturate the spectrum.
OpenBTS-UMTS include 3G data http://openbts.org/w/index.php?title=OpenBTS-UMTS
You can download and compile on Ubuntu 16.04, there is some issue with dependencies on Ubuntu 18.04.
About hardware, i used both Ettus USRP N210 and X310.