Author Topic: Balanduino app communication protocol  (Read 48 times)

murcha

  • Newbie
  • *
  • Posts: 2
    • View Profile
Balanduino app communication protocol
« on: December 06, 2017, 07:43:54 PM »
Hello, I run a robotics after school programme, and an very impressed with your balanduino robot.
In addition we have been using the joystick tab in the balanduino app to control robots we have created ourselves - its an excellent app and works really well.
However we are also wishing to use the PID and GRAPH tabs of your app as well.
We are able to read the messages from the app fine (i.e. joystick and PID adjust vales), but have not been successful in sending data to the PID (to fill the Current Values section) and the GRAPH tabs.
We have studied the balanduino code in detail, and our understanding of the message flows are shown below:
 
Message initiator       Message sent from App                        Message sent from Balanduino                         Comments

Joystick tag                          CS;                                    ------------->                                                                        joystick in center position - works fine
                                               CJ,xxx,yyy;                       ------------->                                                                        joystick in other positions - works fine

PID tag                                 SP,xxx;                             ------------->                                                                         P value - works fine
                                              SI,xxx;                              ------------->                                                                         I value - works fine
                                              SD,xxx;                            ------------->                                                                         D value - works finr
                                              ST,xxx;                             ------------->                                                                         T value - works fine

                                              GP;                                   ------------->                                                                        request for current PID values
 data snt from robot                                                   <-------------             P,xxx,xxx,xxx,xxx/n                        robot response to GP; request - but PID values not populated in app

Graph tag
data sent from robot                                                 <-------------             V,xxx,xxx,xxx/n                                sent every 50ms - but graph not populated


Just wondering if you could give me some pointers as to why the PID Current Values section of the PID tag, and the Graph tag does not respond to the data messages we are sending. Note the BT card in he robot is set up for 9600 baud.

Again many thanks for your excellent work.

Lauszus

  • Administrator
  • Full Member
  • *****
  • Posts: 134
    • View Profile
Re: Balanduino app communication protocol
« Reply #1 on: December 07, 2017, 01:56:49 PM »
Hi murcha,

Thanks for the positive feedback.

I just tested it on Mac by simply sending "P,1,2,3,4" and that worked fine. Can you test it in a serial terminal on a computer?

Btw the newline character is written as "\n", but it should not matter if you send it or not.

Regards
Kristian Sloth Lauszus

murcha

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Balanduino app communication protocol
« Reply #2 on: December 08, 2017, 05:21:38 AM »
Hi there,

Thanks for that.
I tried your suggestion, it works fine from a serial terminal on my PC.
However sending the same string from the arduino through a HC-05 BT card (using the arduino HW UART, pin 0 and 1) doesn't seem to work - however sometimes when the BT connection is first established the string sent from the arduino/HC05 will be detected, but only once and only somethimes.
I have tried a HC-05 from two different suppliers - no difference.
All very strange.
Have you come across anything similar in the past ?

Thanks again
Alan Murch


Lauszus

  • Administrator
  • Full Member
  • *****
  • Posts: 134
    • View Profile
Re: Balanduino app communication protocol
« Reply #3 on: December 14, 2017, 10:27:04 AM »
Alan,

Can you connect up a oscilloscope to the HC-05 and make sure something is outputted? Btw have you configured to use the right baud rate?

Regards
Kristian Sloth Lauszus