ControlMotoDriver - calling method is crashing the whole app

Grove is a modulated, ready-to-use tool set.
Much like Lego, it takes a building block approach to assembling electronics.

Moderators: lily.li, violet, salmanfarisvp, jeremy882, crail.lyu969

Post Reply
nace
Pre-kindergarten
Pre-kindergarten
Posts: 15
Joined: Mon Jul 30, 2018 3:09 pm

ControlMotoDriver - calling method is crashing the whole app

Post by nace » Mon Jul 30, 2018 3:22 pm

Hello!

I've came accross with a strange issue while calling ControlMotoDriver using GrovePi library (dll).

Code: Select all

sensorController.ControlMotoDriver(true);
        public void ControlMotoDriver(Boolean onoff)
        {
            if (onoff)
            {
                motor.drive1(100);
                motor.drive2(100);
            } else
            {
                motor.drive1(0);
                motor.drive2(0);
            }
        }
Calling this method causes the whole application to crash (restart). Is there any known issues around that? Is there any possiblity that application is crashing because using wrong port on the GrovePi+?

Thank your for your kind help,
Nace

bill.yu
Junior-7
Junior-7
Posts: 735
Joined: Mon Apr 02, 2018 11:05 am

Re: ControlMotoDriver - calling method is crashing the whole app

Post by bill.yu » Tue Jul 31, 2018 2:00 pm

Hi Nace,

please help take a picture of whole setup. we can see if we can simulate the issue. thanks.

Bill

nace
Pre-kindergarten
Pre-kindergarten
Posts: 15
Joined: Mon Jul 30, 2018 3:09 pm

Re: ControlMotoDriver - calling method is crashing the whole app

Post by nace » Tue Jul 31, 2018 3:33 pm

The setup has been established using your documentation: https://github.com/Seeed-Studio/AzureGroveKit

Grove GrovePi Port
D2 Grove - Temp&Humi Sensor
D3 Grove - PIR Motion Sensor
D4 Grove – Button
D5 Grove - Relay
A0 Grove - Sound Sensor
A1 Grove - Light Sensor
A2 Grove - Gas Sensor
I2C1 Grove - OLED Display 0.96"
I2C2 Grove - Mini I2C Motor Driver
grove_setup_f.png
grove_setup_f.png (5.09 MiB) Viewed 3003 times

hong.jiang
Staff
Staff
Posts: 200
Joined: Tue Apr 17, 2018 11:03 am

Re: ControlMotoDriver - calling method is crashing the whole app

Post by hong.jiang » Wed Aug 01, 2018 3:33 pm

Dear Nace:
I have got your question. I'm assembling raspberry with GrovePi+ and other sensor to test it.And I will reply you as soon as possible.

nace
Pre-kindergarten
Pre-kindergarten
Posts: 15
Joined: Mon Jul 30, 2018 3:09 pm

Re: ControlMotoDriver - calling method is crashing the whole app

Post by nace » Fri Aug 03, 2018 9:44 pm

Any progress on that? We've bought GrovePi+, because there is written that is can be used for fast prototyping - now we have bunch of problems, not only with Moto Driver, but with LCD display too...

bill.yu
Junior-7
Junior-7
Posts: 735
Joined: Mon Apr 02, 2018 11:05 am

Re: ControlMotoDriver - calling method is crashing the whole app

Post by bill.yu » Mon Aug 06, 2018 5:31 pm

Hi Nace, Sorry for the late response, we try to simulate the issue. but we stuck at some place. I talked with software team manager. He is looking at the issue now. thanks.

best rgds
Bill

User avatar
xuguang.shao
Staff
Staff
Posts: 38
Joined: Tue May 20, 2014 1:57 pm

Re: ControlMotoDriver - calling method is crashing the whole app

Post by xuguang.shao » Thu Aug 09, 2018 8:20 pm

Hi Nace,
Is there any possiblity that application is crashing because using wrong port on the GrovePi+?
No, the I2C Grove doesn't care which I2C port you're connecting it to, your problem might be caused by bad network communication to the Azure, in which case the program will throw an exception which is not catch-ed. I've updated the code to catch these exceptions. Please try our latest App bundle with instructions here: https://github.com/Seeed-Studio/AzureGr ... /README.md
Reach the unreal.

nace
Pre-kindergarten
Pre-kindergarten
Posts: 15
Joined: Mon Jul 30, 2018 3:09 pm

Re: ControlMotoDriver - calling method is crashing the whole app

Post by nace » Tue Aug 14, 2018 4:45 pm

xuguang.shao wrote:
Thu Aug 09, 2018 8:20 pm
No, the I2C Grove doesn't care which I2C port you're connecting it to, your problem might be caused by bad network communication to the Azure, in which case the program will throw an exception which is not catch-ed. I've updated the code to catch these exceptions. Please try our latest App bundle with instructions here: https://github.com/Seeed-Studio/AzureGr ... /README.md
Dear xuguang shao!

I've updated my code with your improvements on Github. Now i am able to print out the error. After calling the following line:

Code: Select all

sensorController.ControlMotoDriver(true);
i got this error:

"Sorry...The system cannot find the file specified. Slave address was not acknowledged. Contact us for help"

Otherwise the communication with Azure IoT HUB is working fine - we've already managed to establish a connection for other sensors (temp., hum., PIT, ...).

What am i doing wrong? Please help.

nace
Pre-kindergarten
Pre-kindergarten
Posts: 15
Joined: Mon Jul 30, 2018 3:09 pm

Re: ControlMotoDriver - calling method is crashing the whole app

Post by nace » Fri Aug 24, 2018 12:27 pm

Any progress on this? We've done some research and tried out some methods, but we are still unable to start the motor using GrovePi C# library.

User avatar
xuguang.shao
Staff
Staff
Posts: 38
Joined: Tue May 20, 2014 1:57 pm

Re: ControlMotoDriver - calling method is crashing the whole app

Post by xuguang.shao » Fri Aug 24, 2018 4:33 pm

I've successfully driven the Grove - Mini I2C Motor Driver, and there's no same issue reported for this, so I can temporarily conclude that your issue isn't a common one.
We've done some research and tried out some methods
Could you share more informations about your research? Have you tried other I2C Groves e.g. Grove - OLED Display 0.96" ?

From the error message
"Sorry...The system cannot find the file specified. Slave address was not acknowledged. Contact us for help"
What I get from the message is, the Grove - Mini I2C Motor Driver may be damaged. Have you tried to drive this Grove via an Arduino board? Or grab some board that can do I2C scan, does the Grove - Mini I2C Motor Driver respond to any I2C communications?
Reach the unreal.

Post Reply