Weather board and ultrasonic module simultanous operation

Moderators: odroid, mdrjr

Weather board and ultrasonic module simultanous operation

Unread postby ring0x00 » Tue Dec 04, 2018 9:02 pm

The ultrasonic module and weather-board are working fine one at a time, however, I want both of them to work, as I need information from both. My connections are:

Ultrasonic module:

Code: Select all
Grnd Pin 20
Trig Pin 18
Echo pin 16
VCC pin 2, or 4.


Weather-board:

Code: Select all
p3v45 Pin 1
scl pin 5
sda pin 3
Grnd pin 9.


when I plug both of them, the red LED starts blinking and the odroid-c1 does not come up. is there any workaround ?
Last edited by ring0x00 on Wed Dec 05, 2018 6:24 am, edited 1 time in total.
ring0x00
 
Posts: 2
Joined: Tue Dec 04, 2018 8:53 pm
languages_spoken: english
ODROIDs: c1, u3

Re: Weather board and ultrasonic module simultanous operatio

Unread postby tobetter » Tue Dec 04, 2018 11:36 pm

From your description, there is no reason both sensors are not working.
Can you put the weather-board first and connect a line of the ultrasonic module one by one from VCC?
I guess VCC and GND are shorted for some reason and the board doesn't boot.
User avatar
tobetter
 
Posts: 2557
Joined: Mon Feb 25, 2013 10:55 am
Location: Paju, South Korea
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1

Re: Weather board and ultrasonic module simultanous operatio

Unread postby ring0x00 » Wed Dec 05, 2018 6:27 am

It seems the HC-RS04 and aml_i2c driver are not compatible with each other
when I try to insert the hc-rs04 kernel module, I get the following kernel message:

[ 581.573421] HC-SR04 driver initializing.
[ 581.573433] Trigger GPIO: 104.
[ 581.573437] Echo GPIO: 102.
[ 581.573496] ERROR(amlogic_setup_irq) : already allocation irq bank!!
[ 581.573503] ERROR(amlogic_setup_irq) : gpio = 102, bank = 0
[ 581.573509] amlogic_gpio_to_irq : amlogic setup irq fail!
[ 581.573513] Rising IRQ mapping failed.

but I dont know how to solve the problem.
ring0x00
 
Posts: 2
Joined: Tue Dec 04, 2018 8:53 pm
languages_spoken: english
ODROIDs: c1, u3

Re: Weather board and ultrasonic module simultanous operatio

Unread postby rooted » Wed Dec 05, 2018 6:53 am

There are two adjustable parameters in the driver.

Code: Select all
// Two parameters available:
//   pecho is for the echo pin
//   ptrg is for the trigger pin
//
module_param(pecho, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(pecho, "ECHO Pin for HC. Default pin 95 [PC31]");
module_param(ptrg, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(ptrg, "TRIGGER Pin for HC. Default pin 91 [PC27]");


When you run modprobe change the trigger and echo to match.
User avatar
rooted
 
Posts: 5908
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english


Return to Hardware and peripherals

Who is online

Users browsing this forum: No registered users and 2 guests