Shield with Tuner question

Home Forums Hardware AutoSense Shield Shield with Tuner question

This topic contains 11 replies, has 2 voices, and was last updated by Profile photo of -Jeff- -Jeff- 1 year, 1 month ago.

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #2907
    Profile photo of -Jeff-
    -Jeff-
    Participant

    Eric,

    what is the order of events for the DUE to boot up? does it wait for a USB connection prior to initializing? I am wondering if you are able to connect to the tuner and start running the init commands on power up. then once the USB connection is determined you are able to control it from android. but I know the Arduino has limitations, I have just noticed at times ( I forget how I got there) that the system is all connected but the Tuner is not recognized. Now that could have been prior to me finding the bad cable. I am going to put the shield back in the car as well. I will be leaving the USB Cable for the tuner int he car and I have also thought of making one cable so I can swap between the USB and yours if I have issues.

    #2908
    Profile photo of Eric
    Eric
    Keymaster

    When the Due boots up it goes into a infinite loop looking to initialize the USB bus.  It presents itself to the Android which then pops up the dialog asking for permission to use it.  Once that is established it keeps looking for data incoming or outgoing and sends it off.

    The best test I can think of is check the temperature sensors.  If they’re working but the HD Tuner isn’t then it’s not the Android-Arduino connection, but the Arduino-HD Tuner connection, likely the bad cable you have.  The white and yellow wires are the serial port wires, without them no communication can happen.

    #2909
    Profile photo of -Jeff-
    -Jeff-
    Participant

    Okay.. my cable issue aside.

    when the DUE boots in the loop for the USB, I assume it is looking to see if it is master or slave, depending on the connected USB port right?

    What if (assuming a DIO pin is available) you set a pin as input, if High, then Android is host, if Low then Due is host, while still requiring the cables connection as they are, so if the line is low, which is checked on power up only ( or reset button pushed) it ‘sets’ the mode, then the USB confirms it.

    I have to imagine the code is complex to determine which USB to use, I have also seen where the USB says the arduino is connected but there is no Data (not Tuner connection and Temp sensors aren’t working) which made me think, what if it was in the loop for USB and stuck there.. that would explain a good USB connection and no response

     

     

    • This reply was modified 1 year, 1 month ago by Profile photo of -Jeff- -Jeff-.
    #2911
    Profile photo of Eric
    Eric
    Keymaster

    The host/slave selection is automatically done.  In fact both are initialized and running simultaneously at all times.  The library that enables the USB comms just does a check to see if data is available, and if so, send it or receive it.

    The majority of the complications is in fact on the Android side.

    I’ve had a few ideas on how to improve reliability, things like the Arduino auto-rebooting itself until the USB is connected.

    A lot of the difficulty is lack of documentation and having to dig through code to find the problem.

    #2912
    Profile photo of -Jeff-
    -Jeff-
    Participant

    So I found yesterday that using the USB direct cable and app for the Tuner also have issues. The app force closed/quit a few times. I had to mess with it to restart it. Yours is a lot nicer so I am looking forward to getting the Shield in the car is a more accessible place.. maybe tonight

     

    #2913
    Profile photo of -Jeff-
    -Jeff-
    Participant

    Okay..

    Fresh boot for Android, Shield and Tuner.. everything works

    Key off

    key on, Android comes out of Standby, Fresh start for Shield and tuner. Android did not find Shield until I unplugged/plugged Shield, then it found the shield, It thought is found the tuner, but no audio, no able to reset tuner or change stations

    Key off

    Key On.. Android and Shield both in standby.. Fresh Start Tuner.. Shield detected, No HDTUNER.

    Key off.

    Key on, fresh start for everything.. all worked.. took time for the HDTuner and shield to be detected though for whatever reason.

    Key Off,

    Key On, fresh start everything.. worked same as above.. tuner takes time

    I will try it again shortly.

    I have  some questions..

    What is done, when accessory power is removed and the Shield is set for a delay to turn off? meaning, the HDTUNER might be off already, does the DUE still attempt to send commands? maybe it is possible to ‘bypass’ commands if we know the tuner is off, or set a flag stating that the tuner is off and will need to be detected on key on. It is possible that with the shield having delay power off, when I turn the key back on, it thinks the tuner is connected, but since the tuner got turned off, it no longer has the actual connection and it thinks it does?

     

     

    • This reply was modified 1 year, 1 month ago by Profile photo of -Jeff- -Jeff-.
    #2915
    Profile photo of -Jeff-
    -Jeff-
    Participant

    Other than needing to add my radio delay module (OEM) for the windows and radio to stay on with key off..

    It works much better with everything off and a fresh start every time.. sometimes annoying, but tolerable

    My son asked why I changed radio apps again.. LOL, I like yours better, I do have a couple minor requests for it, but I need to get the screen shots off the radio and show you when I explain them

    Biggest one is more presets…

    🙂

     

     

     

    #2916
    Profile photo of -Jeff-
    -Jeff-
    Participant

    got in car today.. it did not detect the DUE or shield.. so no tuner. Drove it to wherever I was going. Shut car off. Restarted a bit later.

    DUE was detected this time, but tuner was trying to work.. I pressed a preset and I heard the Tuner ‘click’

    I swapped back to my Serial/USB cable and Tuner was fine.. I am thinking maybe the Headunit I have will not play nice with the shield

    #2924
    Profile photo of Eric
    Eric
    Keymaster

    I totally missed this.

    What is done, when accessory power is removed and the Shield is set for a delay to turn off? meaning, the HDTUNER might be off already, does the DUE still attempt to send commands? maybe it is possible to ‘bypass’ commands if we know the tuner is off, or set a flag stating that the tuner is off and will need to be detected on key on. It is possible that with the shield having delay power off, when I turn the key back on, it thinks the tuner is connected, but since the tuner got turned off, it no longer has the actual connection and it thinks it does?

    The shield stays on with the delay.  The HD Tuner could very well be off at this point, and AutoSense will still try to send commands, however nothing will happen, the go into the abyss.  When the tuner is on again it would need a new power-up command to be sent.  I wonder if you connect both red and yellow wires of the radio to constant power will this draw current when the radio is off?  This is something I’d like to test, but maybe you can do it before me.  If the current draw is minimal or none, then maybe keep it that way.  The radio wouldn’t draw any power when off.  I’d just have to make sure the power off command is sent before the Arduino cuts power.  The only issue is the Arduino has no idea when the power will be cut, it just happens…

    Maybe I could add a command to the power controller IC to send a “cleanup” signal to the Arduino before power is cut.  You’d have to reprogram the Attiny on board the shield with the new software, but this could make sure the Arduino gracefully shuts things down before power removal and restores them when power comes back.

     

    As for presets 6 isn’t enough 😉  I don’t have that many stations here that play good music 😛

    It shouldn’t be difficult to add the ability to add more, I just wanted to start simple, get basics working somewhat then add more.  It is on the list though.

    #2925
    Profile photo of -Jeff-
    -Jeff-
    Participant

    I think the better solution is to use one of the outputs for the switched 12v to the HDTuner, then you will know when the power is removed. send the off command then turn power off. Then no issues on current draw with the key off gives you more closed loop control. I would actually prefer this. then the switch 12 is still switched, but if the Shield is controlling it, then all the better.

     

    #2926
    Profile photo of Eric
    Eric
    Keymaster

    I agree.  Just at the moment the outputs aren’t fully working… most stuff to finish :S

    #2927
    Profile photo of -Jeff-
    -Jeff-
    Participant

    Understood, but I would think getting one of the outputs to work would be better than doing a band-aid, then implementing it the way you want.

    Like I said, I can test things out, either on the radio unit itself or my bench set-up

     

     

  • Author
    Posts
  • #2907
    Profile photo of -Jeff-
    -Jeff-
    Participant
    • Offline

    Eric,

    what is the order of events for the DUE to boot up? does it wait for a USB connection prior to initializing? I am wondering if you are able to connect to the tuner and start running the init commands on power up. then once the USB connection is determined you are able to control it from android. but I know the Arduino has limitations, I have just noticed at times ( I forget how I got there) that the system is all connected but the Tuner is not recognized. Now that could have been prior to me finding the bad cable. I am going to put the shield back in the car as well. I will be leaving the USB Cable for the tuner int he car and I have also thought of making one cable so I can swap between the USB and yours if I have issues.

    #2908
    Profile photo of Eric
    Eric
    Keymaster
    • Offline

    When the Due boots up it goes into a infinite loop looking to initialize the USB bus.  It presents itself to the Android which then pops up the dialog asking for permission to use it.  Once that is established it keeps looking for data incoming or outgoing and sends it off.

    The best test I can think of is check the temperature sensors.  If they’re working but the HD Tuner isn’t then it’s not the Android-Arduino connection, but the Arduino-HD Tuner connection, likely the bad cable you have.  The white and yellow wires are the serial port wires, without them no communication can happen.

    #2909
    Profile photo of -Jeff-
    -Jeff-
    Participant
    • Offline

    Okay.. my cable issue aside.

    when the DUE boots in the loop for the USB, I assume it is looking to see if it is master or slave, depending on the connected USB port right?

    What if (assuming a DIO pin is available) you set a pin as input, if High, then Android is host, if Low then Due is host, while still requiring the cables connection as they are, so if the line is low, which is checked on power up only ( or reset button pushed) it ‘sets’ the mode, then the USB confirms it.

    I have to imagine the code is complex to determine which USB to use, I have also seen where the USB says the arduino is connected but there is no Data (not Tuner connection and Temp sensors aren’t working) which made me think, what if it was in the loop for USB and stuck there.. that would explain a good USB connection and no response

     

     

    • This reply was modified 1 year, 1 month ago by Profile photo of -Jeff- -Jeff-.
    #2911
    Profile photo of Eric
    Eric
    Keymaster
    • Offline

    The host/slave selection is automatically done.  In fact both are initialized and running simultaneously at all times.  The library that enables the USB comms just does a check to see if data is available, and if so, send it or receive it.

    The majority of the complications is in fact on the Android side.

    I’ve had a few ideas on how to improve reliability, things like the Arduino auto-rebooting itself until the USB is connected.

    A lot of the difficulty is lack of documentation and having to dig through code to find the problem.

    #2912
    Profile photo of -Jeff-
    -Jeff-
    Participant
    • Offline

    So I found yesterday that using the USB direct cable and app for the Tuner also have issues. The app force closed/quit a few times. I had to mess with it to restart it. Yours is a lot nicer so I am looking forward to getting the Shield in the car is a more accessible place.. maybe tonight

     

    #2913
    Profile photo of -Jeff-
    -Jeff-
    Participant
    • Offline

    Okay..

    Fresh boot for Android, Shield and Tuner.. everything works

    Key off

    key on, Android comes out of Standby, Fresh start for Shield and tuner. Android did not find Shield until I unplugged/plugged Shield, then it found the shield, It thought is found the tuner, but no audio, no able to reset tuner or change stations

    Key off

    Key On.. Android and Shield both in standby.. Fresh Start Tuner.. Shield detected, No HDTUNER.

    Key off.

    Key on, fresh start for everything.. all worked.. took time for the HDTuner and shield to be detected though for whatever reason.

    Key Off,

    Key On, fresh start everything.. worked same as above.. tuner takes time

    I will try it again shortly.

    I have  some questions..

    What is done, when accessory power is removed and the Shield is set for a delay to turn off? meaning, the HDTUNER might be off already, does the DUE still attempt to send commands? maybe it is possible to ‘bypass’ commands if we know the tuner is off, or set a flag stating that the tuner is off and will need to be detected on key on. It is possible that with the shield having delay power off, when I turn the key back on, it thinks the tuner is connected, but since the tuner got turned off, it no longer has the actual connection and it thinks it does?

     

     

    • This reply was modified 1 year, 1 month ago by Profile photo of -Jeff- -Jeff-.
    #2915
    Profile photo of -Jeff-
    -Jeff-
    Participant
    • Offline

    Other than needing to add my radio delay module (OEM) for the windows and radio to stay on with key off..

    It works much better with everything off and a fresh start every time.. sometimes annoying, but tolerable

    My son asked why I changed radio apps again.. LOL, I like yours better, I do have a couple minor requests for it, but I need to get the screen shots off the radio and show you when I explain them

    Biggest one is more presets…

    🙂

     

     

     

    #2916
    Profile photo of -Jeff-
    -Jeff-
    Participant
    • Offline

    got in car today.. it did not detect the DUE or shield.. so no tuner. Drove it to wherever I was going. Shut car off. Restarted a bit later.

    DUE was detected this time, but tuner was trying to work.. I pressed a preset and I heard the Tuner ‘click’

    I swapped back to my Serial/USB cable and Tuner was fine.. I am thinking maybe the Headunit I have will not play nice with the shield

    #2924
    Profile photo of Eric
    Eric
    Keymaster
    • Offline

    I totally missed this.

    What is done, when accessory power is removed and the Shield is set for a delay to turn off? meaning, the HDTUNER might be off already, does the DUE still attempt to send commands? maybe it is possible to ‘bypass’ commands if we know the tuner is off, or set a flag stating that the tuner is off and will need to be detected on key on. It is possible that with the shield having delay power off, when I turn the key back on, it thinks the tuner is connected, but since the tuner got turned off, it no longer has the actual connection and it thinks it does?

    The shield stays on with the delay.  The HD Tuner could very well be off at this point, and AutoSense will still try to send commands, however nothing will happen, the go into the abyss.  When the tuner is on again it would need a new power-up command to be sent.  I wonder if you connect both red and yellow wires of the radio to constant power will this draw current when the radio is off?  This is something I’d like to test, but maybe you can do it before me.  If the current draw is minimal or none, then maybe keep it that way.  The radio wouldn’t draw any power when off.  I’d just have to make sure the power off command is sent before the Arduino cuts power.  The only issue is the Arduino has no idea when the power will be cut, it just happens…

    Maybe I could add a command to the power controller IC to send a “cleanup” signal to the Arduino before power is cut.  You’d have to reprogram the Attiny on board the shield with the new software, but this could make sure the Arduino gracefully shuts things down before power removal and restores them when power comes back.

     

    As for presets 6 isn’t enough 😉  I don’t have that many stations here that play good music 😛

    It shouldn’t be difficult to add the ability to add more, I just wanted to start simple, get basics working somewhat then add more.  It is on the list though.

    #2925
    Profile photo of -Jeff-
    -Jeff-
    Participant
    • Offline

    I think the better solution is to use one of the outputs for the switched 12v to the HDTuner, then you will know when the power is removed. send the off command then turn power off. Then no issues on current draw with the key off gives you more closed loop control. I would actually prefer this. then the switch 12 is still switched, but if the Shield is controlling it, then all the better.

     

    #2926
    Profile photo of Eric
    Eric
    Keymaster
    • Offline

    I agree.  Just at the moment the outputs aren’t fully working… most stuff to finish :S

    #2927
    Profile photo of -Jeff-
    -Jeff-
    Participant
    • Offline

    Understood, but I would think getting one of the outputs to work would be better than doing a band-aid, then implementing it the way you want.

    Like I said, I can test things out, either on the radio unit itself or my bench set-up

     

     

Viewing 12 posts - 1 through 12 (of 12 total)

You must be logged in to reply to this topic.