Go to advanced search

by jerryk
Sun May 09, 2021 7:33 pm
Forum: Python
Topic: Read SPI data from unknown device
Replies: 21
Views: 1455

Re: Read SPI data from unknown device

If you use pigpiod with fast signals, then you should use callbacks for all related GPIO. When using callbacks for clock only, then the callback will be triggered in the python code when data line has changed state already. When using callback for clock and data, then the callback calls are arrivin...
by jerryk
Sun May 09, 2021 7:22 pm
Forum: Python
Topic: Read SPI data from unknown device
Replies: 21
Views: 1455

Re: Read SPI data from unknown device

joan wrote:
Sun May 09, 2021 5:05 pm
The documentation says not to use read in a callback. It even gives the reason.

http://abyz.me.uk/rpi/pigpio/python.html#callback
Yes it does say that very clearly!! Sorry I missed it. Thanks to the post above I think things on this project are going into the solved bin.

Thanks - Jerry
by jerryk
Sun May 09, 2021 4:44 pm
Forum: Python
Topic: Read SPI data from unknown device
Replies: 21
Views: 1455

Re: Read SPI data from unknown device

That looks more like I2C than SPI. https://www.engineersgarage.com/microcontroller-projects/articles-raspberry-pi-i2c-protocol/ https://pypi.org/project/smbus2/ I looked at the info on pi-i2c and it talks about i2c standard speeds 100 kHz and above. The pulse I'm currently working with is 8 kHz. Th...
by jerryk
Sat May 08, 2021 10:43 pm
Forum: Python
Topic: Read SPI data from unknown device
Replies: 21
Views: 1455

Re: Read SPI data from unknown device

The help above solved all problems with reading the Guardline sensor data. I am trying to add one other motion detection system (Optex) to this project but it communicates at 8 kHz rather than the 800 Hz of the Guardline. I appears that Rpi.GPIO is too slow for 8 kHz. Another issue is there is no ch...
by jerryk
Fri May 07, 2021 6:22 am
Forum: Python
Topic: python script to play audio from RaspberryPi using vlc
Replies: 4
Views: 493

Re: python script to play audio from RaspberryPi using vlc

Try adding:

Code: Select all

sleep(5)
After this line in your code.

Code: Select all

player.play()


Jerry
by jerryk
Mon May 03, 2021 9:17 pm
Forum: Python
Topic: Read SPI data from unknown device
Replies: 21
Views: 1455

Re: Read SPI data from unknown device

The script I linked is using callbacks. Why not just use piscope? http://abyz.me.uk/rpi/pigpio/piscope.html It can capture the data and you can save it to a file. If you want you can replay the captured data into another script to process it again. http://abyz.me.uk/rpi/pigpio/examples.html#Python_...
by jerryk
Mon May 03, 2021 8:15 pm
Forum: Python
Topic: Read SPI data from unknown device
Replies: 21
Views: 1455

Re: Read SPI data from unknown device

I had to test it. This code works with the info you provided. I programmed a STM32 Blue Pill to output data like your master. Ensure you have GND connected to the other device. That's perfect!! I attached the output of testing sensors pair to tunes 1 and 19 (4 times each). Then I scroll through the...
by jerryk
Mon May 03, 2021 2:35 am
Forum: Python
Topic: Read SPI data from unknown device
Replies: 21
Views: 1455

Re: Read SPI data from unknown device

It is slow. The frequency I measured was around 806 Hz. I will try to count the high and low pulses and see if it yields consistent result.

Thanks - Jerry
by jerryk
Mon May 03, 2021 2:03 am
Forum: Python
Topic: Read SPI data from unknown device
Replies: 21
Views: 1455

Re: Read SPI data from unknown device

I did have that backwards between MOSI and MISO. The Micro of the base station sends a binary 1 to the tune chip and it plays tune number 1. I was trying to use SPI_mon.py which was suggested in the first reply to accomplish the task. It sounds like you are suggesting using something like Rpi.GPIO a...
by jerryk
Mon May 03, 2021 12:43 am
Forum: Python
Topic: Read SPI data from unknown device
Replies: 21
Views: 1455

Re: Read SPI data from unknown device

Here are 3 screen shots from the motion sensor base station. Keep in mind that I am trying to monitor or sniff the spi lines on this base station that is not connected or controlled by the raspberry pi. There are four lines (1 clock and 3 data)that appear to have spi data between the microcontroller...
by jerryk
Sun May 02, 2021 10:25 pm
Forum: Python
Topic: Read SPI data from unknown device
Replies: 21
Views: 1455

Re: Read SPI data from unknown device

Installed pigpio and have the SPI Monitor program running. It works great using the MCP3008 and a temperature sensor. But when I hook up the the motion sensor receiver it distorts the clock signal from the motion sensor receiver and I have no output from SPI_mon.py or the tune generator. Looking at ...
by jerryk
Sun May 02, 2021 7:05 pm
Forum: Python
Topic: Read SPI data from unknown device
Replies: 21
Views: 1455

Re: Read SPI data from unknown device

Yes I do. The blue trace is the clock and the yellow trace is the data lines.

The link you sent seems the match the description of what I am try the do as in passively sniff the communication line.

Jerry
by jerryk
Sun May 02, 2021 6:50 pm
Forum: Python
Topic: Read SPI data from unknown device
Replies: 21
Views: 1455

Read SPI data from unknown device

I have tapped into a device that selects and plays specific ring tones when individual motion detectors are triggered. The communication appears to be SPI between a ring tone IC chip and a microcontoller. Attached is a couple of screen shots of the data from the microcontroller sent to the unknown r...
by jerryk
Thu Jan 03, 2019 9:10 pm
Forum: Other projects
Topic: tell the pi to do something from remote place
Replies: 7
Views: 1681

Re: tell the pi to do something from remote place

I've been using the Twilio sms API for a couple of years now to do this. I have tried Nexmo as an alternative but the network is too slow for my puposes. There a plenty of competitors in this field and you can pick the one that suits you best. The process has a cost (around .0075 us per text) that v...
by jerryk
Thu Jan 03, 2019 6:57 pm
Forum: Python
Topic: Warning,.. check your i2c settings! messages
Replies: 1
Views: 1121

Warning,.. check your i2c settings! messages

I have two fresh raspian installs on Pi 3b's and I get the following message when I use the pydoc documentation. With this command: python3 -m pydoc -k math Or any other key string I might use - I get this warning at the end of the output: Warning, could not find Analog or Touch... Please check your...
by jerryk
Wed Jan 02, 2019 12:57 am
Forum: Automation, sensing and robotics
Topic: Relay Line out voltage causing voltage on line in
Replies: 31
Views: 4975

Re: Relay Line out voltage causing voltage on line in

I used the same relay board in an alarm system interface. I'm switching 12v and lower circuits but as far as driving all 8 of the relays directly from the pi goes I opted to use a separate power supply and 2n3904's to activate the relay coils. Although I used the primary pins on the pi to drive the ...
by jerryk
Mon Dec 31, 2018 8:49 pm
Forum: Automation, sensing and robotics
Topic: Alarm System using existing DSC wiring
Replies: 13
Views: 8995

Re: Alarm System using existing DSC wiring

Here is the schematic of what I did to interface with my old school existing system. I'm not sure there is any generic solution to be had out there and there was a lot of reverse engineering of the existing system to solve the problem at hand. Hacking the keypad was the most difficult in that it use...
by jerryk
Wed Dec 19, 2018 1:11 am
Forum: Python
Topic: Spidev/Spi issue migrating from python 2.7 to 3.5.3
Replies: 3
Views: 935

Re: Spidev/Spi issue migrating from python 2.7 to 3.5.3

It looks like you are not getting reliable readings from the MCP3008, you could try adding the spi.max speed setting , this seems to have solved a lot of problems with the pi not connecting reliably with the MCP3008. #Create SPI spi = spidev.SpiDev() spi.open(0, 0) spi.max_speed_hz=1000000 Wow -- T...
by jerryk
Sun Dec 16, 2018 6:42 pm
Forum: Automation, sensing and robotics
Topic: Alarm System using existing DSC wiring
Replies: 13
Views: 8995

Re: Alarm System using existing DSC wiring

I started on a similar project two years ago. The initial concept was helped along by this forum in this thread ( https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=164662&p=1069577#p1069577 ). You can take a look and see if it helps further what you are trying to do. The hardwired loop...
by jerryk
Thu Dec 13, 2018 11:36 pm
Forum: Python
Topic: Spidev/Spi issue migrating from python 2.7 to 3.5.3
Replies: 3
Views: 935

Spidev/Spi issue migrating from python 2.7 to 3.5.3

I have some python code that uses the mcp3008 chip and spidev to monitor temperatures in my home. It's been running for a year now but does not function now that migrated the code to a fresh install of noobs v3.00 and using python 3. It runs on the old distribution under python's 2 and 3 on the old ...
by jerryk
Thu Dec 13, 2018 10:39 pm
Forum: Python
Topic: How to send Text messages
Replies: 4
Views: 4624

Re: How to send Text messages

I use both Twilio and Nexmo.

Twilio has a short video that goes through the setup for python:

https://www.youtube.com/watch?v=knxlmCVFAZI&t=106s

They also front you twenty dollars on your account so you can try it.

Jerry
by jerryk
Thu Dec 13, 2018 8:36 am
Forum: Python
Topic: Upgrade Python from 3.5.3 to latest version
Replies: 15
Views: 74594

Re: Upgrade Python from 3.5.3 to latest version

I may have confused why smbus is now working. I have created a virtual environment two ways Case One is: python3 -m venv venv/ Case Two is: python3 -m venv venv/ --system-site-packages Case one is using home/pi/venv/pip inside the virtual environment and install all libraries to the virtual environm...
by jerryk
Wed Dec 12, 2018 4:33 pm
Forum: Python
Topic: Upgrade Python from 3.5.3 to latest version
Replies: 15
Views: 74594

Re: Upgrade Python from 3.5.3 to latest version

Thanks to all of your help and with the addition of information in this thread https://www.raspberrypi.org/forums/viewtopic.php?t=122260 , I think I understand the smbus problem and may have resolved it. It appears to be an issue with the distribution itself. Using: sudo find / -name *smbus* I locat...
by jerryk
Wed Dec 12, 2018 12:33 am
Forum: Python
Topic: Upgrade Python from 3.5.3 to latest version
Replies: 15
Views: 74594

Re: Upgrade Python from 3.5.3 to latest version

I set up a new venv called venv1 with the following: python3 -m venv venv1/ --system-site-packages The resulting pip freeze within the activated environment does not show smbus or any variant of it. Trying: sudo apt install python3-smbus Returns: python3-smbus is already the newest version (3.1.2-3)...
by jerryk
Tue Dec 11, 2018 8:31 pm
Forum: Python
Topic: Upgrade Python from 3.5.3 to latest version
Replies: 15
Views: 74594

Re: Upgrade Python from 3.5.3 to latest version

I am using a virtual environment that was created using: python3 -m venv venv/ when I try to import smbus using the following two differing methods this output is observed: (venv) pi@raspberrypi:~/projects/venv $ pip3 install smbus Looking in indexes: https://pypi.org/simple, https://www.piwheels.or...

Go to advanced search