Go to advanced search

by fivdi
Sat Jun 08, 2019 10:27 am
Forum: General discussion
Topic: SCL frequency of Raspberry Pi 3b+
Replies: 2
Views: 161

Re: SCL frequency of Raspberry Pi 3b+

The default I2C baudrate on the Raspberry Pi is 100000. It can be modified in "/boot/config.txt", for example to change the baudrate to 400000 add the following line to "/boot/config.txt".

Code: Select all

dtparam=i2c_baudrate=400000
It may be necessary to reboot the Pi for the change to take effect.
by fivdi
Sat Jun 08, 2019 9:51 am
Forum: General discussion
Topic: Raspberry Pi 0 W and armv6
Replies: 33
Views: 5154

Re: Raspberry Pi 0 W and armv6

Hum.... node.js seems to have the same fate as Java now... Hope Python have better luck. For developing software that can last decades, we shall go back to use trusted C I guess. Although Node.js officially dropped support for ARMv6 builds recently, there are still unofficial ARMv6 builds available...
by fivdi
Sat Jun 08, 2019 9:35 am
Forum: General discussion
Topic: node.js problem with serialport ?
Replies: 2
Views: 103

Re: node.js problem with serialport ?

Another potential way to resolve the issue would be to run the program using this command:

Code: Select all

sudo $(which node) Documents/SendRS485.js

Rather than this command:

Code: Select all

sudo node Documents/SendRS485.js
This should force user root to use the same version of Node.js as user pi.
by fivdi
Sat Jun 08, 2019 9:04 am
Forum: General discussion
Topic: node.js problem with serialport ?
Replies: 2
Views: 103

Re: node.js problem with serialport ?

The error occurred because serialport was installed using Node.js v11.x but at runtime Node.js v10.x was used. The NODE_MODULE_VERSION numbers for all the different versions of Node.js can be found at https://nodejs.org/en/download/releases/ serialport is not a pure JavaScript module, it's a native ...
by fivdi
Sat Jun 08, 2019 8:21 am
Forum: Troubleshooting
Topic: SPI not working when using Johnny Five [resolved]
Replies: 4
Views: 223

Re: SPI not working when using Johnny Five [resolved]

1) Did you compare the "onoff" and "pigpio" packages for your digital IO, and if so why did you choose "onoff"? I would imagine that gtripoli chose onoff rather than pigpio because it was only necessary to read the value of a GPIO input pin. pigpio offers a lot more functionality than onoff but pig...
by fivdi
Wed Jun 13, 2018 7:38 pm
Forum: Troubleshooting
Topic: GPIO relay signal cross
Replies: 113
Views: 4414

Re: GPIO relay signal cross

@bwertman, @pcbobman Congratulations :)
by fivdi
Sun Jun 03, 2018 8:53 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI Can't Read from an ADXL345 Accelerometer
Replies: 1
Views: 795

Re: SPI Can't Read from an ADXL345 Accelerometer

The program posted in the first comment above doesn't set max_speed_hz but the following program does: import spidev spi = spidev.SpiDev() spi.open(0,0) spi.mode = 3 spi.max_speed_hz = 5000000 id = spi.xfer2([128,0]) print 'Device ID (Should be 0xE5): ' + hex(id[1]) Unfortunately setting max_speed_h...
by fivdi
Sun Jun 03, 2018 8:38 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: [Solved] ADC (MCP3008) Converter (for joysticks) no longer works, now always returns zero's
Replies: 16
Views: 1225

Re: ADC (MCP3008) Converter (for joysticks) no longer works, now always returns zero's

If an older Linux kernel is being used (<=4.8.y) the default max. SPI frequency is 500kHz, see https://github.com/raspberrypi/linux/blob/rpi-4.8.y/arch/arm/boot/dts/bcm2710-rpi-3-b.dts#L126 If a newer Linux kernel is being used (>=4.9.y) the default max. SPI frequency is 125MHz, see https://github.c...
by fivdi
Wed May 30, 2018 6:38 pm
Forum: Beginners
Topic: Dual i2c configuration.
Replies: 2
Views: 190

Re: Dual i2c configuration.

It's possible to connect multiple devices to the same I2C bus as long as those devices have unique addresses.
by fivdi
Tue May 22, 2018 9:17 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI Can't Read from an ADXL345 Accelerometer
Replies: 1
Views: 795

SPI Can't Read from an ADXL345 Accelerometer

The goal of the following Python program is to read the Device ID register (register 0x00) from an ADXL345 Triple-Axis Accelerometer connected to a Raspberry Pi 2 using SPI. import spidev spi = spidev.SpiDev() spi.open(0,0) spi.mode = 3 id = spi.xfer2([128,0]) print 'Device ID (Should be 0xE5): ' + ...
by fivdi
Tue Mar 27, 2018 8:00 pm
Forum: Automation, sensing and robotics
Topic: how to select channel of mcp3002 selecting channel?
Replies: 3
Views: 311

Re: how to select channel of mcp3002 selecting channel?

To me, it looks like the three byte array passed to xfer2 doesn't contain the correct data. Pass a two byte array rather than a three byte array with the following data (shown in binary here): 011c1000 00000000 c is the channel number c = 0 means channel 0 c = 1 means channel 1 The result should loo...
by fivdi
Sat Feb 24, 2018 9:56 am
Forum: Automation, sensing and robotics
Topic: MCP9808 Temperature Sensing and More With Node.js
Replies: 0
Views: 297

MCP9808 Temperature Sensing and More With Node.js

There's a new Node.js module for the MCP9808 temperature sensor at mcp9808-temperature-sensor . In addition to providing the ability to read the temperature this module goes the extra mile and can also be used to efficiently detect alerts with real hardware interrupts. Here are some additional Node....
by fivdi
Fri Feb 09, 2018 8:33 pm
Forum: Troubleshooting
Topic: Damaged GPIO 2 SDA
Replies: 5
Views: 661

Re: Damaged GPIO 2 SDA

The Pi 3 has a second I2C bus on pins 27 and 28.
Perhaps that works.
See https://pinout.xyz/pinout/i2c#
See also viewtopic.php?f=44&t=137848
by fivdi
Sun Jan 14, 2018 11:34 am
Forum: Troubleshooting
Topic: Pi 2 & 3 not detcting i2C devices, Pi 1 does ...
Replies: 9
Views: 1308

Re: Pi 2 & 3 not detcting i2C devices, Pi 1 does ...

I wonder if using i2cdetect -y -r 1 rather than i2cdetect -y 1 makes a difference. I doubt it but it's worth a try. With the -r option the SMBus Receive Byte protocol is used to detect devices. Without the -r option the SMBus Quick Write protocol is used.
by fivdi
Sun Jan 14, 2018 11:17 am
Forum: Beginners
Topic: NodeJs <-> Arduino Serial library?
Replies: 3
Views: 750

Re: NodeJs <-> Arduino Serial library?

The GitHub project linked to above is implemented in C++ and doesn't provide Node.js bindings. This means it can't be used from Node.js. There's a Node.js library called Node Serialport that can be used for serial communication with an Arduino. I'd suggest giving that a try. See https://github.com/n...
by fivdi
Sat Jan 13, 2018 7:38 pm
Forum: C/C++
Topic: (Solved) I2c device not found (MPU6050)
Replies: 2
Views: 820

Re: I2c device not found (MPU6050)

The code linked to was written quite a long time ago and looks like it was implemented for a Raspberry Pi 1. The code assumes that the I2C bus can be accessed using /dev/i2c-0. On a more recent Pi like the Zero, 2 or 3 this is not the case and /dev/i2c-1 should be used. For example, see https://gith...
by fivdi
Sat Dec 09, 2017 6:03 pm
Forum: Beginners
Topic: Bash script to create file?
Replies: 6
Views: 1139

Re: Bash script to create file?

Yes, that may very well be the case.
by fivdi
Sat Dec 09, 2017 5:49 pm
Forum: Beginners
Topic: Bash script to create file?
Replies: 6
Views: 1139

Re: Bash script to create file?

It looks like there were two answers at more or less the same time. If you chose the variant suggested by rpdom it needs a small modification. There's a / missing so replace this:

Code: Select all

touch "/home/pi/newproject $(date +%y%m%d%H%M%S)"
with this:

Code: Select all

touch "/home/pi/newproject/$(date +%y%m%d%H%M%S)"
by fivdi
Sat Dec 09, 2017 5:43 pm
Forum: Beginners
Topic: Bash script to create file?
Replies: 6
Views: 1139

Re: Bash script to create file?

Something like this should do it:

Code: Select all

#!/bin/bash
FILE_NAME="$(date +%Y%m%d%H%M%S)"
touch "/home/pi/newproject/${FILE_NAME}"
by fivdi
Mon Dec 04, 2017 12:42 pm
Forum: Python
Topic: Struggling to run Firmata test program on my RP3
Replies: 6
Views: 885

Re: Struggling to run Firmata test program on my RP3

Ah, ok. I think the program you downloaded is for 32 bit Intel machines but the Raspberry Pi has an ARM processor.
by fivdi
Mon Dec 04, 2017 12:27 pm
Forum: Python
Topic: Struggling to run Firmata test program on my RP3
Replies: 6
Views: 885

Re: Struggling to run Firmata test program on my RP3

Does it work if you cd to the directory containing firmata_test and run it with 'sudo ./firmata_test' rather than 'sudo firmata_test'?
by fivdi
Mon Dec 04, 2017 11:53 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: MCP3008 via SPI0 gives reading on not connected channels
Replies: 1
Views: 455

Re: MCP3008 via SPI0 gives reading on not connected channels

If the tutorial at https://learn.adafruit.com/raspberry-pi-analog-to-digital-converters?view=all was used and everything was connected up as suggested by the tutorial the input voltage range for each channel is 0V through 3.3V. In this case, connecting sensors that output 5V wouldn't be the best of ...
by fivdi
Mon Dec 04, 2017 11:17 am
Forum: Python
Topic: Cannot Read/Write to i2c bus
Replies: 7
Views: 3353

Re: Cannot Read/Write to i2c bus

Just as an example, I did a few tests with an MCP9808 because I don't have a PCA9685 at hand. According to the datasheet the MCP9808 can run at clock frequencies of up to 400kHz. See http://ww1.microchip.com/downloads/en/DeviceDoc/25095A.pdf, page 5. A quick test on a Pi 3 showed that it actually ap...
by fivdi
Mon Dec 04, 2017 10:51 am
Forum: Raspbian
Topic: esp8266 & serial AMA0
Replies: 10
Views: 2614

Re: esp8266 & serial AMA0

@liderbug: congratulations :D
by fivdi
Mon Dec 04, 2017 10:49 am
Forum: Python
Topic: Cannot Read/Write to i2c bus
Replies: 7
Views: 3353

Re: Cannot Read/Write to i2c bus

The PCA9685 chipset will run in I2C fast mode at 400Kbit/s whcih is as fast as any I2C bus will go, so baud rate isn't a problem with that chip According to the datasheet the PCA9685 can run at up to 1000Kbit/s in fast-mode plus. See https://cdn-shop.adafruit.com/datasheets/PCA9685.pdf, page 40. If...

Go to advanced search