Go to advanced search

by danjperron
Sat Oct 20, 2018 2:47 am
Forum: General discussion
Topic: MFRC522 and Raspberry pi 3
Replies: 1
Views: 52

Re: MFRC522 and Raspberry pi 3

This is a modifed version that I removed the bcm2835 library. https://github.com/danjperron/rc522_reader There is code to read and write the card. The current method is to execute a command according to the contents of /etc/RC522.conf git clone https://github.com/danjperron/rc522_reader cd rc522_rea...
by danjperron
Wed Oct 17, 2018 3:14 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI
Replies: 2
Views: 62

Re: SPI

Wow respond to an 4 years old post with new request. Good chance that the post is obsolete! You don't need the bcm2835 library to run a mcp3008 or SPI. There is wiringpi. And the kernel could access the mcp3008 dtoverlay=mcp3008,<param>[=<val>] check /boot/overlays/README This is my most recent post...
by danjperron
Tue Oct 16, 2018 10:40 pm
Forum: C/C++
Topic: I am missing some fundamental understanding of C?
Replies: 13
Views: 323

Re: I am missing some fundamental understanding of C?

free() is explicitly defined as to do nothing if passed NULL so it is perfectly safe. Yes of course but calling image->data when image is NULL is a big problem! Hey I learned C using CP/M on a Osborne portable computer with floppy disk. At that time you have to be aware of everything. So it is an h...
by danjperron
Tue Oct 16, 2018 7:28 pm
Forum: C/C++
Topic: I am missing some fundamental understanding of C?
Replies: 13
Views: 323

Re: I am missing some fundamental understanding of C?

I found few bugs in your code that you should fix and there is other also. 1- I got a problem with your image_load_png() function. I found out that it try to free memory when they are NULL pointer. I fix the problem by modifying void image_free(Image *image) { if(image !=NULL) if(image->data !=NULL)...
by danjperron
Tue Oct 16, 2018 3:41 pm
Forum: C/C++
Topic: I am missing some fundamental understanding of C?
Replies: 13
Views: 323

Re: I am missing some fundamental understanding of C?

lfb.putpixel this looks like c++ not C. Please provide the name of the library you are using and the headers info of your source files. The include stuff at the beginning. I think that you need to pass lfb into your function but since we don't know which libraries or missing function you are using i...
by danjperron
Tue Oct 16, 2018 2:51 pm
Forum: Beginners
Topic: How can I connect Canbus and RFID to the same PI?
Replies: 7
Views: 290

Re: How can I connect Canbus and RFID to the same PI?

Go back to the basic, - Check if it is working without the RFID on chip select 0. (set overlay for chip select 0). - Is spidev there ? ls -l /dev/spi* - Is device in module lsmod - Is any error on boot up dmesg | grep mcp dmesg | grep spi - Is your 8Mhz clock oscillate ? (you need a oscilloscope or ...
by danjperron
Tue Oct 16, 2018 11:30 am
Forum: General discussion
Topic: RS485 Communication with Pi Compute 3L
Replies: 7
Views: 180

Re: RS485 Communication with Pi Compute 3L

Is there any code through which I can read data on UART of raspberry pi from MAX485 or any library support? What protocol are you using? If it is modbus there is minimalmodbus. Like I explain above the serial driver from the Pi has problem to control the max485 direction. If you want to stick with ...
by danjperron
Mon Oct 15, 2018 10:30 pm
Forum: Troubleshooting
Topic: GPIO UART won't go above 115200 baud
Replies: 8
Views: 248

Re: GPIO UART won't go above 115200 baud

Are you using C or python ?


I don't see the code for the Raspberry Pi.
by danjperron
Mon Oct 15, 2018 10:26 pm
Forum: Troubleshooting
Topic: GPIO UART won't go above 115200 baud
Replies: 8
Views: 248

Re: GPIO UART won't go above 115200 baud

Well you could forget about the arduino.

You could control the WS1812 led strip directly using the Raspberry Pi.
https://www.raspberrypi.org/forums/view ... 0#p1369823
by danjperron
Mon Oct 15, 2018 6:43 pm
Forum: Automation, sensing and robotics
Topic: Yet more DHT22 sensor code
Replies: 100
Views: 68707

Re: Yet more DHT22 sensor code

Hum... You should remove from the loop the GPIO setup and the sensor setup. This should be before the loop. pi.set_mode(22,pigpio.OUTPUT) pi.write(22,1) s=DHT22.sensor(pi,2, LED=None, power=22) Set the GPIO mode could start a DHT22 read out befor the s.trigger(), then you get garbage. I don't think ...
by danjperron
Sat Oct 13, 2018 1:14 pm
Forum: Troubleshooting
Topic: Controlling another Serial Com device from the raspberry PI 3 Model B V1.2 over serial Port
Replies: 9
Views: 207

Re: Controlling another Serial Com device from the raspberry PI 3 Model B V1.2 over serial Port

time out! if you don't received anything after the time out which is 5 second the function return no string "\0". My GPS always output something. Maybe yours needs a command to send something. Increase the timeout or add the function in_waiting() to check if there is any character in the received bu...
by danjperron
Fri Oct 12, 2018 12:45 pm
Forum: General discussion
Topic: RS485 Communication with Pi Compute 3L
Replies: 7
Views: 180

Re: RS485 Communication with Pi Compute 3L

It is really weird that you need to multiplex the RS-485 since RS-485 is by itself a bus system. (ALl RS-485 connected together). I thing that you should go to the bare I.C. since you are allowed to enable the receive and the transmit signal. A simple 74HC138 , on GPIO control for a,b,c input, conne...
by danjperron
Thu Oct 11, 2018 11:11 pm
Forum: Python
Topic: Periodically update DS3231 RTC with NTP
Replies: 10
Views: 177

Re: Periodically update DS3231 RTC with NTP

ut I'm just not sure how to monitor whether the RTC has just been read from the OS Found it When you insert the module with modprobe, you should restart the time system using sudo systemctl restart systemd-timesyncd and you could check if the time has been update using [email protected]:~ $ sudo systemctl sta...
by danjperron
Thu Oct 11, 2018 10:59 pm
Forum: Python
Topic: Periodically update DS3231 RTC with NTP
Replies: 10
Views: 177

Re: Periodically update DS3231 RTC with NTP

If the DTS file for your RTC specifies that it's a "wakeup-source", you should have a /sys/class/rtc/rtc0/wakealarm Interesting but, [email protected]:/sys/class/rtc/rtc0 $ ls date dev device hctosys max_user_freq name power since_epoch subsystem time uevent Nope the DTS doesn't have it set. I think that it i...
by danjperron
Thu Oct 11, 2018 10:13 pm
Forum: Python
Topic: Periodically update DS3231 RTC with NTP
Replies: 10
Views: 177

Re: Periodically update DS3231 RTC with NTP

does modprobe require a system reboot?
I do have a DS3231. I just check it and the modprobe works perfectly after Ia rmmod.
No reboot is needed!

For the wait until RTC I'm not sure . I'll check the message log to see if it is displayed!
by danjperron
Thu Oct 11, 2018 11:16 am
Forum: General discussion
Topic: RS485 Communication with Pi Compute 3L
Replies: 7
Views: 180

Re: RS485 Communication with Pi Compute 3L

I did a module using modbus and I found out that the handshake of the PI was not reliable to control the direction of the signal. Then I added a small cpu to control the direction and it works perfectly! I don't like the idea to connect the direction with the send.It removes symetry of the signal, T...
by danjperron
Sun Oct 07, 2018 11:27 pm
Forum: Python
Topic: Periodically update DS3231 RTC with NTP
Replies: 10
Views: 177

Re: Periodically update DS3231 RTC with NTP

For the ntp sync .

maybe you should ping and restart systemd.

Code: Select all

until ping -nq -c3 8.8.8.8; do
   echo "Waiting for network..."
done
sudo systemctl restart systemd-timesyncd
by danjperron
Sun Oct 07, 2018 11:11 pm
Forum: Python
Topic: Periodically update DS3231 RTC with NTP
Replies: 10
Views: 177

Re: Periodically update DS3231 RTC with NTP

I made a class with the ds1307. The ds3231 is very similar to the ds3231. So similar that the driver for the ds3231 is the ds1307! check my post in french, (use google translate). https://www.raspberrypi.org/forums/viewtopic.php?f=65&t=166853&hilit=ds1307 If you want to play with the alarm. 1- Wait ...
by danjperron
Sun Oct 07, 2018 5:28 pm
Forum: Beginners
Topic: How to I2C in C ?
Replies: 4
Views: 137

Re: How to I2C in C ?

I made a wrapper in C.

Check I2CWrapper.c and the header.

https://github.com/danjperron/A2D_PIC_RPI
by danjperron
Sat Oct 06, 2018 11:18 am
Forum: Beginners
Topic: HC-05 and Pi
Replies: 11
Views: 238

Re: HC-05 and Pi

I do have some HC05/HC06 bluetooth device connected to my Raspberry Pi.

I'm using rfcomm to link them

/usr/bin/rfcomm bind /dev/rfcomm1 00:12:06:20:94:53

Please check rfcomm
by danjperron
Sat Oct 06, 2018 10:59 am
Forum: Weather station
Topic: Temps are off by about 10 degrees (F)
Replies: 9
Views: 196

Re: Temps are off by about 10 degrees (F)

On the first post the link is not between url tag ! I can't figure out the real url What kind of weather station? How is the DS18B20 connected? I know from a fact that the ds18B20 normally is more accurate ! I got a problem once and I find out that the internal heat from the box and the electronic p...
by danjperron
Thu Oct 04, 2018 10:34 pm
Forum: Beginners
Topic: Controlling electric roller blinds
Replies: 9
Views: 1845

Re: Controlling electric roller blinds

I did something like this using an eps8266 with a stepper motor https://www.instructables.com/id/Motorized-WiFi-IKEA-Roller-Blind/ The source code doesn't use the correct output for the shield. (The new shield version is different) I put the new code on Github https://github.com/danjperron/ESP12EMot...
by danjperron
Thu Oct 04, 2018 11:11 am
Forum: General discussion
Topic: Wire setting for my heat sensor with rpi3 b plus
Replies: 5
Views: 165

Re: Wire setting for my heat sensor with rpi3 b plus

The DHT111 use a special serial protocol. It's not I2c and it is not TTL serial. Check this old post that I made a long time ago. https://www.raspberrypi.org/forums/viewtopic.php?f=32&t=96647&p=671849#p671849 You could use pigpio to read it. There is also a kernel driver but I prefer Joan's version ...

Go to advanced search