adding i2c device in raspberry pi device tree source - linux

I am learning to add i2c devices in device tree of raspberry's kernel 4.4.8. After successful compilation of DT, raspberry pi is not allowing me to log in to board.
showing "ssh: connect to host 10.1.1.103 port 22: Connection refused".
I have linked dt sources below
DT Souce.
one by one, I tried adding in all following files.
in file bcm2708-rpi-b.dts line 93. (lm75#48).
in file bcm2708-rpi-b-plus.dts line no. 87.
in file bcm2708.dtsi line no. 44.
Please help me. Any help will be appreciated.
Thanks.

Related

Raspberry pi interfacing rfid module rc522

i have been trying to interface the rc522 rfid module but i cant seem to make it work. can someone help?
I am using this tutorial: https://pimylifeup.com/raspberry-pi-rfid-rc522/
I have enables SPI
None of my GPIOs are fried, i have checked them using this guide: https://forums.raspberrypi.com/viewtopic.php?t=268806
I have downloaded the libraries needed!
I have wired it this way:
The only difference is that I am using a rpi zero 2w
I have installed all libraries and i have written the code, but the rfid module doesnt seem to read or write
Can someone help me?
Discord: Yasen#7752 This is the pins i have wired the module on my rpi zero 2w.
I tried running this code:
#!/usr/bin/env python
import RPi.GPIO as GPIO
from mfrc522 import SimpleMFRC522
reader = SimpleMFRC522()
try:
text = input('New data:')
print("Now place your tag to write")
reader.write(text)
print("Written")
finally:
GPIO.cleanup()
but it didn't seem to work!
This is an example output:
pi#raspberrypi:~/pi-rfid $ sudo python3 Write.py
New data:pimylifeup
Now place your tag to write
Written
My program just doesn't print "Written". I am assuming it has something to do with the rfid modules.
Once again the tutorial i am using is: https://pimylifeup.com/raspberry-pi-rfid-rc522/. I have almost no experience as I am only 14, but i would really use some help! Thanks!

Bluetooth address is already in use - Raspberry pi

I want to connect my phone with the raspberry pi via bluetooth and for that, I'm using this code
from bluedot.btcomm import BluetoothServer
from signal import pause
def data_received(data):
print(data)
s.send(data)
s = BluetoothServer(data_received)
pause()
Sometimes It's working fine I'm able to connect my phone and send data but some times its shows error like
Bluetooth address B8:27:EB:DA:25:25 is already in use - is the server already running?
Traceback (most recent call last):
File "mypyscript/mainscript.py", line 8, in s = BluetoothServer(data_received)
File "/home/pi/.local/lib/python2.7/site-packages/bluedot/btcomm.py", line 358, in start
raise e
socket.error: [Errno 98] Address already in use
I copied this code from here

LIBUSB_ERROR_BUSY [-6] Sending a basic packet with Python 3.9 using LibUSB1

I am developing some software in python 3.9 and I am at the point where I have a device connected to my USB port and would like to send a basic packet to test the interface before I proceed. I am using this example to try and get my interface to work. I am not bothered about speed or byte count. I would like to see any response on the interface (But on reflection Im wondering if usb speed could be the issue):
import usb1
import usb.util
import os
import sys
import libusb
import usb.core
from usb import util
import math
dev = usb.core.find(idVendor=0x11ac,idProduct=0x317d)
with usb1.USBContext() as context:
handle=context.openByVendorIDAndProductID(
0x11ac,
0x317d,)
handle.claimInterface(0)
handle.setInterface(0)
data = bytearray(b"\\xf0\\x0f"* (int(math.ceil(0xb5db91/4.0))))
handle.controlWrite(0x40, 0xb0, 0xb5A6, 0xdb91, b"")
handle.bulkWrite(2,data,timeout=5000)
`
https://github.com/vpelletier/python-libusb1/issues/21
I have had a look in various forums for several days and cannot seem to get an answer that works. Here is the trace: Its worth noting that from time to time, this py file does run without error but does nothing, and I see no traffic traveling to the USB interface.
Can someone please help me configure a working example of how to send a packet to the interface? I have tried various things like detaching the kernel, setting configuration, etc.
For 4 days I have struggled with libusb01 & 10, after discovering libusb1, I have changed my wrapper and got a lot more success
I also see a lot of examples in forums like this one, and I always get the same response. Also Im curious as to where it appears that 0x40 is the endpoint(out)
Traceback (most recent call last):
File "/home/jbgilbert/Desktop/Packets/Backend_replace.py", line 16, in <module>
handle.claimInterface(0)
File "/usr/lib/python3/dist-packages/usb1/__init__.py", line 1213, in claimInterface
libusb1.libusb_claim_interface(self.__handle, interface),
File "/usr/lib/python3/dist-packages/usb1/__init__.py", line 133, in mayRaiseUSBError
__raiseUSBError(value)
File "/usr/lib/python3/dist-packages/usb1/__init__.py", line 125, in raiseUSBError
raise __STATUS_TO_EXCEPTION_DICT.get(value, __USBError)(value)
usb1.USBErrorBusy: LIBUSB_ERROR_BUSY [-6]
My device is a laptop, using lsmod reveals all devices linked to that particular end point, in this case because if the presence of a webcam I was unable to write to an available end point. Despite disabling the driver I had no avail and had to try to code on a machine that had less onboard accessories that proved more successful

Raspberry pi WebIOPi all pictures are 403 forbidden

I'm writing a remote controlled car using a Raspberry Pi. My control interface is a website on the raspberry using WebIOPi to access my python all is working as hoped. Then I wanted to change my text buttons with images, but all I get is a 403.
<img src="images/stop.png" id="stop" class="img-responsive" alt="stop" />
GET http://172.30.1.26:8000/images/stop.png 403 ('utf-8' codec can't decode byte 0x89 in position 0: invalid start byte)
Its the first time I'm using a raspberry so there might just be an setting someplace I need to use, but I've looked everywhere and have not been able to find it yet.
You should edit the file located in
/usr/local/lib/python3.5/dist-packages/WebIOPi-0.7.1-py3.5-linux-armv7l.egg/webiopi/protocols/http.py
inside you will find the line
f = codecs.open(path, encoding=encoding)
replace it with
f = codecs.open(path, 'rb')
That should fix your problem. Remember to restart webiopi when done.

PySerial "better" port names for Linux?

Followup question to this: permanent USB port names? (Linux)
On Windows the port names don't change between actual physical ports. They are along the lines of "COM3", "COM6", etc.
On Linux, if I plug one USB device first , it will be "ttyUSB0" and if I plug the same device second in any other physical port it will be "ttyUSB1". That won't work if I want to, say, have 2 Arduinos connected via Pyserial to the PC.
In the above answer I was shown a way to get an IP-like "serial name". How can I feed that to the PySerial class instead?
An example:
import serial
ser = serial.Serial(port = "/dev/USBNAME", baudrate=9600)
ser.close()
ser.open()
if ser.isOpen():
ser.write("test")

Resources