Go to advanced search

by danjperron
Thu Jan 17, 2019 3:06 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Reading Values from 12-bit ADC with Python with I2C
Replies: 7
Views: 1948

Re: Reading Values from 12-bit ADC with Python with I2C

- On your first post I don't see when you setup the correct,channel, differential and polarity. You need to set the config First. B.T.W. you specify 11001000 for channel 0 but it is wrong it is supposed to be 10001000. check Table 1 Channel Configuration. - Too bad that i2c_smbus_read_word_swapped d...
by danjperron
Wed Jan 16, 2019 9:03 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Linux ioctl SPI "discussion" - anybody?
Replies: 11
Views: 535

Re: Linux ioctl SPI "discussion" - anybody?

OK I read more and there are some commands with a lot of parameters. Then it is not only 32 bits but to be sure that all parameters are read. This explain why so many NOP. Figure 7.1.13 show that even if CSX is high that do not end the command so you have to be sure that any commands are done before...
by danjperron
Wed Jan 16, 2019 8:39 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Linux ioctl SPI "discussion" - anybody?
Replies: 11
Views: 535

Re: Linux ioctl SPI "discussion" - anybody?

Ok it is not about SPI itself but about the ILI9341 and why they use 4 bytes to reset. Page 36 of the datasheets The read mode has three types of transmitted command data (8-/24-/32-bit) according command code. Then to ensure that the reset is not in a middle of a 32 bits command we have to send som...
by danjperron
Wed Jan 16, 2019 6:11 pm
Forum: Beginners
Topic: Lost of Modbus connection after a few minutes
Replies: 7
Views: 878

Re: Lost of Modbus connection after a few minutes

Hey this look like what I did but my version is multi IO. You could connect more than a DHT11 on it! https://www.raspberrypi.org/forums/viewtopic.php?f=44&t=75189&p=583646&hilit=+multiio#p563861 If you look at the image of that linked post you will notice that I'm using the same USB adapter. You nee...
by danjperron
Wed Jan 16, 2019 3:49 pm
Forum: Automation, sensing and robotics
Topic: DHT11 IoT
Replies: 1
Views: 141

Re: DHT11 IoT

You forget to indent more because if result is not valid then it will check result.temperature even if the data is bad. import RPi.GPIO as GPIO import dht11 import time from time import sleep # The script as below using BCM GPIO 00..nn numbers GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) relays=[2...
by danjperron
Wed Jan 16, 2019 3:25 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Linux ioctl SPI "discussion" - anybody?
Replies: 11
Views: 535

Re: Linux ioctl SPI "discussion" - anybody?

So where is your example code. ?


Never had problem with spi.

Maybe check my example when I modified the RC522_reader to use IOCTL instead of the bcm2835 library.

Function HW_init and my_spi_transfer in main.c

https://github.com/danjperron/rc522_reader
by danjperron
Tue Jan 15, 2019 7:46 pm
Forum: Beginners
Topic: Lost of Modbus connection after a few minutes
Replies: 7
Views: 878

Re: Lost of Modbus connection after a few minutes

Looks ok!

How many instrument connected?
What type of cable?
Is terminators at each end of the cable?
What is the USB adapter connected to the Pi?
What is the model of the sensor?
Is there a physical ground between both unit?
by danjperron
Tue Jan 15, 2019 4:51 pm
Forum: General discussion
Topic: Raspberry Pi and RS-485
Replies: 3
Views: 511

Re: Raspberry Pi and RS-485

I made a lot of testing using the RS-485 with different methods. Why I2c or SPI? The simplest way is USB. They are so cheap that is not worth re-invent them. https://www.dx.com/p/usb-to-rs485-adapter-black-green-2039807 I even made a small cpu to take care of the switching. https://github.com/danjpe...
by danjperron
Tue Jan 15, 2019 3:54 pm
Forum: General discussion
Topic: IP camera please?
Replies: 2
Views: 450

Re: IP camera please?

What exactly are you looking for. A raspberry Pi with a camera that could be use like an IP camera? I do have an USB camera connected to a Raspberry PI which I used to check my 3dprinter and a live webcam for my wheel robot. https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=109352&p=751735#p75...
by danjperron
Tue Jan 15, 2019 12:06 pm
Forum: Troubleshooting
Topic: ls cannot access /dev/spi* no such file or directory
Replies: 6
Views: 266

Re: ls cannot access /dev/spi* no such file or directory

Ehm... no, didn't removed them... The driver for the display use all the SPI! Take the display driver out hdmi_force_hotplug=1 config_hdmi_boost=7 hdmi_drive=2 hdmi_force_hotplug=1 hdmi_group=2 hdmi_mode=87 hdmi_cvt 480 320 60 6 0 0 0 dtoverlay=ads7846,cs=1,penirq=25,penirq_pull=2,speed=50000,keep_...
by danjperron
Tue Jan 15, 2019 1:31 am
Forum: Troubleshooting
Topic: ls cannot access /dev/spi* no such file or directory
Replies: 6
Views: 266

Re: ls cannot access /dev/spi* no such file or directory

I’ve installed a display but I’ve removed it.
I think that is your problem. Did you removed the driver of the screen?

Please post your config.txt
by danjperron
Mon Jan 14, 2019 8:25 pm
Forum: Troubleshooting
Topic: ls cannot access /dev/spi* no such file or directory
Replies: 6
Views: 266

Re: ls cannot access /dev/spi* no such file or directory

I’m newbie with Raspberry; I have a B+ and can’t get the SPI to work.
Do you have a SPI monitor with touch screen installed on your PI?

Could you provide the config.txt .
by danjperron
Mon Jan 14, 2019 6:09 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI CS/CE with active high
Replies: 27
Views: 1252

Re: SPI CS/CE with active high

Ok I did this in my luch time. It should work but can't confirm before tonight! Be aware that some 93C46 only works with 5V so you will need some level shifter to make it work. The python3 class import RPi.GPIO as GPIO #ORG = 0 ASSUME 8Bits data class eerom93CX6: def __init__(self,type=9366, CS=12,S...
by danjperron
Mon Jan 14, 2019 3:42 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI CS/CE with active high
Replies: 27
Views: 1252

Re: SPI CS/CE with active high

I did check linux flashroom tool and that device is not listed. This mean even if you set the CS High it won't work Interfacing the chip using bit banging is not complicated. I got some old code in PLM51 with the 93C46 hanging in one diskette at home. This tell you how old that device is ;-) I will ...
by danjperron
Sun Jan 13, 2019 10:23 pm
Forum: C/C++
Topic: ADS1115 changing gain etc using WiringPi
Replies: 4
Views: 424

Re: ADS1115 changing gain etc using WiringPi

You say that the conversion rate will be Pin number+1 but what of the other parameters such as the input multiplexer? The multiplexer is done with the analogRead! ex: analogRead(AD_BASE + chan) where chan is switch (chan) { case 0: config |= CONFIG_MUX_SINGLE_0 ; break ; case 1: config |= CONFIG_MU...
by danjperron
Sun Jan 13, 2019 9:10 pm
Forum: C/C++
Topic: ADS1115 changing gain etc using WiringPi
Replies: 4
Views: 424

Re: ADS1115 changing gain etc using WiringPi

It is a trick! The gain is changed by using digitalWrite with the base pin number you define for the ads1115 setup. Pin number+1 will be the frame rate. #include <stdio.h> #include <wiringPi.h> #include <ads1115.h> #define AD_BASE 120 int main (void) { char * Vref[]={"6.144","4.096","2.048","1.024",...
by danjperron
Sun Jan 13, 2019 1:59 pm
Forum: Automation, sensing and robotics
Topic: DHT11 incorrect readings over distance
Replies: 1
Views: 303

Re: DHT11 incorrect readings over distance

The DHT11 hardware is not made for long distance wiring, You are using audio cable which is very good for shielding noise but have a very high capacitance load , On audio the maximum frequency is about 20Khz but the high pulse of the DHT11 is 28µs (~30KHz) then this is a problem. Also Microphone doe...
by danjperron
Sat Jan 12, 2019 10:02 pm
Forum: General discussion
Topic: acs712 with ads1115
Replies: 2
Views: 102

Re: acs712 with ads1115

You should also check this post for the acs712. https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=221972&hilit=acs712&start=150#p1366441 I put some code to minimize the VCC fluctuation because the ACS712 at 0A is VCC/2. Also the scale is relative to VCC so if VCC change the scale change a litt...
by danjperron
Thu Jan 10, 2019 4:17 am
Forum: Raspbian
Topic: Raspbian Lite: Please have SSH enabled by default
Replies: 21
Views: 1192

Re: Raspbian Lite: Please have SSH enabled by default

If you want to setup 25 cards for a class, why not setup one card, and clone it 24 times? Yes this the best option. You setup one card and you image it. Then you could use a script to change the hostname inside the image file before writing a new card. ;-) P.S. Be sure that the initial SDCard is th...
by danjperron
Thu Jan 10, 2019 2:58 am
Forum: Raspbian
Topic: Raspbian Lite: Please have SSH enabled by default
Replies: 21
Views: 1192

Re: Raspbian Lite: Please have SSH enabled by default

And how do you do that without a keyboard and screen (in a way that's simple for beginners)? just burn the image and plug into the PI3B. Don't forget the first post is about headless. No keyboard and no monitor! So the easiest way to communicate without screen or keyboard is SSH. This is what this ...
by danjperron
Thu Jan 10, 2019 1:18 am
Forum: Raspbian
Topic: Raspbian Lite: Please have SSH enabled by default
Replies: 21
Views: 1192

Re: Raspbian Lite: Please have SSH enabled by default

That's an account already on the operating system. What is being said is how do you make the account? Yes Ubuntu has the account set and force the user to change the password because it is time overdue! This is another method to have the user change the password. Has soon that you login it will ask...
by danjperron
Thu Jan 10, 2019 1:01 am
Forum: Raspbian
Topic: Raspbian Lite: Please have SSH enabled by default
Replies: 21
Views: 1192

Re: Raspbian Lite: Please have SSH enabled by default

Sorry about that . I should have make two posts. I just reply to that specific sentence that in M.O. is wrong! The proof! I just download ubuntu 64 bit server and copy the image into the SDcard. Once it was done I put the card into the PI3 and connect to it using ssh. The first thing it did is to fo...
by danjperron
Wed Jan 09, 2019 7:35 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: MPU6050 I2C FIFO Problem
Replies: 3
Views: 449

Re: MPU6050 I2C FIFO Problem

ok I clean up again and now I used __bswap_16 and removed the two_bytes() function which wasn't ok with sign. The code is way cleaner! At least for the read_fifo_buffer() function. I created an array of short instead of byte. Then I swapped the byte to get the correct value. // MPU6050 code. #includ...
by danjperron
Wed Jan 09, 2019 5:17 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: MPU6050 I2C FIFO Problem
Replies: 3
Views: 449

Re: MPU6050 I2C FIFO Problem

Ok I did check your code. I fixed some bugs. 1 - I renamed read_register to read_word. Registers are 8 bits and you were using that function to get some register info when it needs only 8 bits. 2- Your function read_fifo_buffer was readings 64 samples but didn't wait to be sure that the fifo buffer ...
by danjperron
Wed Jan 09, 2019 12:02 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: MPU6050 I2C FIFO Problem
Replies: 3
Views: 449

Re: MPU6050 I2C FIFO Problem

I did use fifo in my code. Works great!

Check the c++ version

https://github.com/danjperron/mpu6050TestInC

Go to advanced search