Go Down

Topic: Making sense of the YUN wifi and the Linino configuration.  (Read 10204 times) previous topic - next topic

lexical43

I realize this is an old thread.  When I try the code modifications to rc.local suggested by Shapeshifter:

Quote
# Added section to set the handshake line.
# GP19 is connected to D7 of the 32U4 processor.
# This requires setting GP22 high to enable the U7 level shifter.
# This GPIO is already exported.
# Then GP19 needs to be exported, set to output, and finally brought low.
echo 1 > /sys/class/gpio/gpio22/value
echo 19 > /sys/class/gpio/export
echo "high" > /sys/class/gpio/gpio19/direction
echo 0 > /sys/class/gpio/gpio19/value
...and run the sample sketch:

Quote
#include <Bridge.h>

#define READY_PIN 7
#define STATUS_LED 13

void setup(){
  pinMode(STATUS_LED, OUTPUT);
  pinMode(READY_PIN, INPUT_PULLUP);

  digitalWrite(STATUS_LED, HIGH);
  // Give a delay for the AR3391 to reset, in case we were reset as part of a reboot command.
  // See http://playground.arduino.cc/Hardware/Yun#rebootStability, case 3.
  delay (2500);

  // Wait for the ready pin to go low, signaling that the AR3391 is fully booted.
  while (digitalRead(READY_PIN))
  {
    // The pin is still high, so give the LED a quick flash to show we're waiting.
    digitalWrite(STATUS_LED, HIGH);
    delay(100);
    digitalWrite(STATUS_LED,LOW);
    delay(100);
  }
  // When reaching this point, AR3391 is ready.

  // Bridge startup
  digitalWrite(STATUS_LED, HIGH);
  Bridge.begin();
  digitalWrite(STATUS_LED, LOW);

  // Rest of application initalization goes here.
}

void loop() {
  // put your main code here, to run repeatedly:

}
The LED continues to blink indicating it is hanging in the while(digitalReady(READY_PIN))

Thoughts?  My project incorporates powering down the 3391 chip to conserve power.  Seems like this would be very helpful to incorporate into the loop function if I can get it to work...

Thoughts?

jessemonroy650

#16
Aug 14, 2015, 08:05 am Last Edit: Aug 14, 2015, 08:06 am by jessemonroy650
Thoughts?  My project incorporates powering down the 3391 chip to conserve power.  Seems like this would be very helpful to incorporate into the loop function if I can get it to work...

Thoughts?
@lexical43,

Your goal is not the same as the Original Poster. Please start a new thread.

* State what you are trying to do.
* What things you've tried
* What things did no work as you expected.

Also read this: Technical notes on LEDs for the Arduino Yun

Jesse

ShapeShifter

The LED continues to blink indicating it is hanging in the while(digitalReady(READY_PIN))
I'm replying here because it's a general comment relating to the original discussion, and perhaps this new addition. One thing to keep in mind is that this idea uses pin D7, so that pin must not be used for any other purpose. If there is any hardware connected to that pin, it may affect operation of the handshake scheme. Perhaps this is an issue?

As a debugging step, monitor the voltage on pin D7. If it stays high all the time, it's a problem on the Linux side or a hardware conflict on the pin. If it eventually goes low and the sketch doesn't recognize it, it's a problem on the sketch side of the equation.

croll12

I am trying to accomplish the same thing here, however I am using a dragino yun shield with mega 2560.  Your post mentions gp19 and 22 then D7.  Is that the same for Mega?  If not, do you know what pins should be used?

ShapeShifter

I am trying to accomplish the same thing here, however I am using a dragino yun shield with mega 2560.  Your post mentions gp19 and 22 then D7.  Is that the same for Mega?  If not, do you know what pins should be used?
What I wrote in this thread applies specifically to the Yun boards made by arduino.cc. It probably also applies to the boards made by arduino.org, but I have not verified that. It does NOT apply to the Yun Shield made by Dragino.

On the Yun boards, which have a built in '32U4 processor, there is a handshake line that goes between pin 7 of the '32U4 processor, and GP19 of the Linux processor, using GP22 as the enable signal of a level shifter that controls that handshake line.

I have no personal experience with the Yun Shield, but I just took a quick look at the schematic. It makes different use of those GPIO lines, and does not have any kind of handshake line that runs to the shield connectors. As far as I can tell, there is no equivalent capability with the Yun Shield, and it does not appear to be possible to do the handshaking that I mention.  :(

Go Up