Thursday, May 4, 2023

ESP NOW Bidirectional data passage between ESP 8266 and ESP 32


The Random Nerd Tutorials tutorials (here and here) for bidirectional communications using ESP NOW have a bit of unnecessary added complexity, in adding humidity sensors, and in the case of ESP32 a OLED screen.  This post presents pared down sketches demonstrating bidirectional data exchange between an ESP 8266 and ESP32.  These are the same development boards used on the previous ESP NOW post, where each processor is installed on a NODEMCU type breakout board.

As in the previous post, I got the MAC address of each device using the sketch provided on the Random Nerd Tutorial links above.  

These MAC addresses are needed for each board to know where to send messages.  Besides this, the Random Nerd Tutorial sketches were changed to replace the humidity sensors with a potentiometer (and remove the screen).  This allows simplification of the data structure, and I added a little logic to trigger a couple LEDs based on the potentiometer position.  This way I don't need to be connected to serial monitor to know that the sketch is working.

Each board takes input from the wiper of their respective potentiometer and the data read is sent to the other board using ESP NOW.  Two LEDs are connected to each board, one for the local pot and one for that connected to the other board.  

ESP 8266 wiring is as follows:

  • 3.3 V -> Pot high side (red wire)
  • GND -> Pot low side (black wire)
  • A0 -> Pot wiper (yellow wire)
  • D6(GPIO12) -> Green LED anode (green wire)
  • Green LED Cathode -> 150 Ohm Resistor -> GND
  • D7(GPIO13) -> Red LED Anode (white wire)
  • Red LED Cathode -> 150 Ohm Resistor -> GND
ESP 32 wiring is similar:

  • 3.3 V -> Pot high side (red wire)
  • GND -> Pot low side (black wire)
  • G34(GPIO 34) -> Pot wiper (yellow wire)
  • G16(GPIO16) -> Green LED anode (green wire)
  • Green LED Cathode -> 150 Ohm Resistor -> GND 
  • G17(GPIO17) -> Red LED Anode (white wire)
  • Red LED Cathode -> 150 Ohm Resistor -> GND 

The LEDs illuminate if the pot wiper is past the halfway point.  Below is when the ESP 32 pot is turned up:


... and when the ESP 8266 wiper is turned up:


Maybe I will make a video later, as the images aren't terribly exciting.

Below is the ESP 8266 sketch:

/*
  This sketch is rework of a sketch first written by Rui Santos and presented on:
  https://RandomNerdTutorials.com/esp-now-two-way-communication-esp8266-nodemcu/
  
  Permission is hereby granted, free of charge, to any person obtaining a copy
  of this software and associated documentation files.
  
  The above copyright notice and this permission notice shall be included in all
  copies or substantial portions of the Software.
*/

#include <esp8266wifi.h>
#include <espnow.h>


// REPLACE WITH THE MAC Address of your receiver 
uint8_t broadcastAddress[] = {0x58, 0xBF, 0x25, 0x31, 0x9D, 0xE0};

int arriving_data=0;
int local_data=0;
const long interval = 200; 
unsigned long previousMillis = 0;

//Structure example to send data
//Must match the receiver structure
typedef struct struct_message {
    int reading;
} struct_message;

// Create a struct_message to hold sensor readings
struct_message outbound;

// Create a struct_message to hold incoming sensor readings
struct_message inbound;

// Callback when data is sent
void OnDataSent(uint8_t *mac_addr, uint8_t sendStatus) {
  Serial.print("Last Packet Send Status: ");
  if (sendStatus == 0){
    Serial.println("Delivery success");
  }
  else{
    Serial.println("Delivery fail");
  }
}

// Callback when data is received
void OnDataRecv(uint8_t * mac, uint8_t *incomingData, uint8_t len) {
  memcpy(&inbound, incomingData, sizeof(inbound));
  Serial.print("Bytes received: ");
  Serial.println(len);
  arriving_data = inbound.reading;
}

void read_pot(){
  local_data = analogRead(A0);
  Serial.print("Pot reading: ");
  Serial.println(local_data);
}

void printIncomingReadings(){
  // Display Readings in Serial Monitor
  Serial.println("INCOMING READINGS");
  Serial.println(arriving_data);
}
 
void setup() {
  // Init Serial Monitor
  Serial.begin(115200);
  pinMode(12,OUTPUT);
  pinMode(13,OUTPUT);
  // Set device as a Wi-Fi Station
  WiFi.mode(WIFI_STA);
  WiFi.disconnect();

  // Init ESP-NOW
  if (esp_now_init() != 0) {
    Serial.println("Error initializing ESP-NOW");
    return;
  }

  // Set ESP-NOW Role
  esp_now_set_self_role(ESP_NOW_ROLE_COMBO);

  // Once ESPNow is successfully Init, we will register for Send CB to
  // get the status of Trasnmitted packet
  esp_now_register_send_cb(OnDataSent);
  
  // Register peer
  esp_now_add_peer(broadcastAddress, ESP_NOW_ROLE_COMBO, 1, NULL, 0);
  
  // Register for a callback function that will be called when data is received
  esp_now_register_recv_cb(OnDataRecv);
}
 
void loop() {
  unsigned long currentMillis = millis();
  if (currentMillis - previousMillis >= interval) {
    // save the last time you updated the DHT values
    previousMillis = currentMillis;

    //Get pot readings
    read_pot();

    //Set values to send
    outbound.reading = local_data;

    // Send message via ESP-NOW
    esp_now_send(broadcastAddress, (uint8_t *) &outbound, sizeof(outbound));

    // Print incoming readings
    printIncomingReadings();
    
  }
  if(arriving_data>2048)
  {
  digitalWrite(12, HIGH);
  } 
  else
  {
    digitalWrite(12, LOW);
  }
  if(local_data>512)
  {
    //Serial.println("writing local led high");
    digitalWrite(13, HIGH);
  }
  else
  {
    //Serial.println("writing local led low");
    digitalWrite(13, LOW);
  }
}
...and the ESP32 sketch:
/*
  This sketch is rework of a sketch first written by Rui Santos and presented on:
  https://RandomNerdTutorials.com/esp-now-two-way-communication-esp32/
  
  Permission is hereby granted, free of charge, to any person obtaining a copy
  of this software and associated documentation files.
  
  The above copyright notice and this permission notice shall be included in all
  copies or substantial portions of the Software.
*/

#include <esp_now.h>
#include <wifi.h>

// REPLACE WITH THE MAC Address of your receiver 
uint8_t broadcastAddress[] = {0xBC, 0xFF, 0x4D, 0x4A, 0x4D, 0x6A};

int arriving_data=0;
int local_data=0;
const long interval = 200; 
unsigned long previousMillis = 0;

//Structure example to send data
//Must match the receiver structure
typedef struct struct_message {
    int reading;
} struct_message;

// Create a struct_message to hold sensor readings
struct_message outbound;

// Create a struct_message to hold incoming sensor readings
struct_message inbound;

esp_now_peer_info_t peerInfo;

// Callback when data is sent
void OnDataSent(const uint8_t *mac_addr, esp_now_send_status_t status) {
  Serial.print("\r\nLast Packet Send Status:\t");
  Serial.println(status == ESP_NOW_SEND_SUCCESS ? "Delivery Success" : "Delivery Fail");
}

// Callback when data is received
void OnDataRecv(const uint8_t * mac, const uint8_t *incomingData, int len) {
  memcpy(&inbound, incomingData, sizeof(inbound));
  Serial.print("Bytes received: ");
  Serial.println(len);
  arriving_data = inbound.reading;
}

void read_pot(){
  local_data = analogRead(34);
  Serial.print("Pot reading: ");
  Serial.println(local_data);
}

void printIncomingReadings(){
  // Display Readings in Serial Monitor
  Serial.println("INCOMING READINGS");
  Serial.println(arriving_data);
}
 
void setup() {
  // Init Serial Monitor
  Serial.begin(115200);
  pinMode(16,OUTPUT);
  pinMode(17,OUTPUT);
 
  // Set device as a Wi-Fi Station
  WiFi.mode(WIFI_STA);

  // Init ESP-NOW
  if (esp_now_init() != ESP_OK) {
    Serial.println("Error initializing ESP-NOW");
    return;
  }

  // Once ESPNow is successfully Init, we will register for Send CB to
  // get the status of Trasnmitted packet
  esp_now_register_send_cb(OnDataSent);
  
  // Register peer
  memcpy(peerInfo.peer_addr, broadcastAddress, 6);
  peerInfo.channel = 0;  
  peerInfo.encrypt = false;
  
  // Add peer        
  if (esp_now_add_peer(&peerInfo) != ESP_OK){
    Serial.println("Failed to add peer");
    return;
  }
  // Register for a callback function that will be called when data is received
  esp_now_register_recv_cb(OnDataRecv);
}
 
void loop() {
  unsigned long currentMillis = millis();
  if (currentMillis - previousMillis >= interval) 
  {
    previousMillis = currentMillis;
    
  read_pot();
 
  // Set values to send
    outbound.reading = local_data;

  // Send message via ESP-NOW
  esp_err_t result = esp_now_send(broadcastAddress, (uint8_t *) &outbound, sizeof(outbound));
   
  if (result == ESP_OK) {
    Serial.println("Sent with success");
  }
  else {
    Serial.println("Error sending the data");
  }

  }
    if(arriving_data>512)
  {
  digitalWrite(16, HIGH);
  } 
  else
  {
    digitalWrite(16, LOW);
  }
  if(local_data>2048)
  {
    //Serial.println("writing local led high");
    digitalWrite(17, HIGH);
  }
  else
  {
    //Serial.println("writing local led low");
    digitalWrite(17, LOW);
  }
}

Surely this circuit could be made even simpler.  As a learning exercise, the novice may consider replacing the potentiometer with a switch and  taking a digital reading rather than powering the local LED by GPIO.

Sunday, December 18, 2022

ESP NOW sender and receiver basic project

ESP Now seems to be a link layer protocol for the ESP 32 and ESP 8266.  It is easy to use for a simple project passing data between an ESP 8266 with a sensor attached, to an ESP 32 with an actuator.

randomnerdtutorials.com has example ESP NOW code for the ESP8266 and ESP32, which form the basis for this project.

The addressing of ESP NOW uses MAC addresses.  In this project, the ESP 8266 is sending data to the ESP 32.  So, the MAC address of the ESP 32 is needed.  There is a code snippet in the link above that can be loaded into the ESP 32, and the MAC address retrieved from Arduino Serial Monitor.  In my case this address was 58:BF:25:31:9D:E0


This was put into the example code from the link above, for the ESP 8266:
/*
  Original Code by Rui Santos, edited for illustration of sensor data forwarding via ESP NOW on ESP 8266
  Complete project details at https://RandomNerdTutorials.com/esp-now-esp8266-nodemcu-arduino-ide/
  
  Permission is hereby granted, free of charge, to any person obtaining a copy
  of this software and associated documentation files.
  
  The above copyright notice and this permission notice shall be included in all
  copies or substantial portions of the Software.
*/

#include <ESP8266WiFi.h>
#include <espnow.h>

// REPLACE WITH RECEIVER MAC Address
uint8_t broadcastAddress[] = {0x58, 0xBF, 0x25, 0x31, 0x9D, 0xE0};

// Structure example to send data
// Must match the receiver structure
typedef struct struct_message {
  char a[32];
  int b;
  float c;
  String d;
  bool e;
} struct_message;

// Create a struct_message called myData
struct_message myData;

unsigned long lastTime = 0;  
unsigned long timerDelay = 250;  // send readings timer

// Callback when data is sent
void OnDataSent(uint8_t *mac_addr, uint8_t sendStatus) {
  Serial.print("Last Packet Send Status: ");
  if (sendStatus == 0){
    Serial.println("Delivery success");
  }
  else{
    Serial.println("Delivery fail");
  }
}
 
void setup() {
  // Init Serial Monitor
  Serial.begin(115200);
 
  // Set device as a Wi-Fi Station
  WiFi.mode(WIFI_STA);

  // Init ESP-NOW
  if (esp_now_init() != 0) {
    Serial.println("Error initializing ESP-NOW");
    return;
  }

  // Once ESPNow is successfully Init, we will register for Send CB to
  // get the status of Trasnmitted packet
  esp_now_set_self_role(ESP_NOW_ROLE_CONTROLLER);
  esp_now_register_send_cb(OnDataSent);
  
  // Register peer
  esp_now_add_peer(broadcastAddress, ESP_NOW_ROLE_SLAVE, 1, NULL, 0);
}
 
void loop() {
  if ((millis() - lastTime) > timerDelay) {
    // Set values to send
    strcpy(myData.a, "THIS IS A CHAR");
    myData.b = analogRead(A0);
    myData.c = 1.2;
    myData.d = "Hello";
    myData.e = false;

    // Send message via ESP-NOW
    esp_now_send(broadcastAddress, (uint8_t *) &myData, sizeof(myData));

    lastTime = millis();
  }
}
The only changes made to the original code are inputting the MAC address of the ESP 32, changing the value of the 'timerDelay' variable, and changing assignment to mydata.b from 'random(1,20);' to 'analogRead(A0);'.  The wiring is as follows:
  • ESP8266 3.3 V Pin to Potentiometer High
  • ESP8266 Gnd Pin to Potentiometer Low
  • ESP8266 A0 Pin to Potentiometer wiper
Once flashed, the ESP8266 is powered by a 5V lithium battery, intended for use as a cellphone battery charger.

The ESP 32 code from the link above also has minor changes:
/*
  Original code by Rui Santos, minor additions made to actuate an LED upon receipt of ESP
  NOW data exceeding an arbitrary threshold.
  Complete project details at https://RandomNerdTutorials.com/esp-now-esp32-arduino-ide/
  
  Permission is hereby granted, free of charge, to any person obtaining a copy
  of this software and associated documentation files.
  
  The above copyright notice and this permission notice shall be included in all
  copies or substantial portions of the Software.
*/

#include <esp_now.h>
#include <WiFi.h>

// Structure example to receive data
// Must match the sender structure
typedef struct struct_message {
    char a[32];
    int b;
    float c;
    bool d;
} struct_message;

// Create a struct_message called myData
struct_message myData;

// callback function that will be executed when data is received
void OnDataRecv(const uint8_t * mac, const uint8_t *incomingData, int len) {
  memcpy(&myData, incomingData, sizeof(myData));
  Serial.print("Bytes received: ");
  Serial.println(len);
  Serial.print("Char: ");
  Serial.println(myData.a);
  Serial.print("Int: ");
  Serial.println(myData.b);
  Serial.print("Float: ");
  Serial.println(myData.c);
  Serial.print("Bool: ");
  Serial.println(myData.d);
  Serial.println();
}
 
void setup() {
  // Initialize Serial Monitor
  Serial.begin(115200);
  pinMode(4, OUTPUT);
    digitalWrite(4, HIGH);
    
  // Set device as a Wi-Fi Station
  WiFi.mode(WIFI_STA);

  // Init ESP-NOW
  if (esp_now_init() != ESP_OK) {
    Serial.println("Error initializing ESP-NOW");
    return;
  }
  
  // Once ESPNow is successfully Init, we will register for recv CB to
  // get recv packer info
  esp_now_register_recv_cb(OnDataRecv);
}
 
void loop() {
if(myData.b>512)
{
  digitalWrite(4, HIGH);
  }
  
  else
  {
    digitalWrite(4, LOW);
    }
}
The only changes made to the original code is addition of the 'if' and 'else' statements within the loop, and 'pinMode(4,OUTPUT);' and 'digitalWrite(4,HIGH);' in setup to make pin 4 ready to actuate an LED. The wiring is as follows:
  • ESP32 Pin 4 to LED Anode
  • LED Cathode to 150 Ohm resistor
  • 150 Ohm Resistor to ESP32 Gnd Pin
Once flashed, the ESP 32 is powered by my PC USB port.  I can monitor the data received on Arduino Serial monitor, and confirm that the LED illuminates when the potentiometer wiper passes the 512 position.


Note "Int: 770", the wiper is past the threshold, the LED is on: 



Now the wiper is below the threshold ('Int: 390') and the LED is off:


Paring down the data structure to only send data that is necessary to function is an exercise left to the reader.

Friday, November 11, 2022

Multi-serial with software serial on Arduino Uno, Nano, etc

A problem an Arduino novice may face is the inclination to connect to a serial device (such as a Loadstar Loadcell read by their proprietary serial interface or a Benewake TF-LC02 Lidar Sensor) to an Arduino board with only one hardware serial interface (such as Arduino Uno or Nano) and then open the Arduino IDE Serial Monitor with hopes of using it to communicate with the serial device. This novice would (hopefully) notice right away that things aren't going as hoped. 

This post explains why this doesn't work.  My own experience is that I could send to the device but not get anything back, which is a little different that what is posted in that link, though I make no claim to knowing why.

The best solution allowing connection of Serial Monitor for input/output to a serial device, in my opinion, is to use an Arduino board with multiple hardware serial interfaces, such as an Arduino MEGA2560. The sample code here allows connection of a serial device to a second serial interface, relays all input and output to the Serial Monitor and vice versa.  This allows for testing of commands to the device, and a more involved sketch can be built out from there.

Unfortunately, the notional novice may be disinclined to buy new hardware.  Arduino does have at least one library for implementing a serial interface via software.  The code below adapts the code from the link above for use with boards with only one hardware serial interface, by using the Arduino Software Serial Library.  

The code:
  /*
  Multiple serial test with software serial

  Receives from the main serial (Serial 0), sends to software serial port configured in the code.
  Receives from software serial port, sends to the main serial port.

  This example works with boards with only one serial like Arduino Uno, Nano etc.

  The circuit:
  - any serial device attached to software serial pins defined below
    -device tx connects to Arduino pin 2
    -device rx connects to Arduino pin 3
    -device GND connects to Arduino GND
    -use own discretion about powering device (Device Vcc to 5v Arduino pin if safe)

  - Serial Monitor open on Serial port 0

  Adapted 10 Nov 2022 from Arduino multi serial code found at:
  https://docs.arduino.cc/built-in-examples/communication/MultiSerialMega.

  Original code:
  created 30 Dec 2008
  modified 20 May 2012
  by Tom Igoe & Jed Roach
  modified 27 Nov 2015
  by Arturo Guadalupi

  This example code is in the public domain.
*/


#include <SoftwareSerial.h>
const byte SSrx = 2;
const byte SStx = 3;

SoftwareSerial SoftSerial (SSrx, SStx);

void setup() {
  // initialize both serial ports:
  Serial.begin(115200);
  pinMode(SSrx, INPUT);
  pinMode(SStx, OUTPUT);
  SoftSerial.begin(115200);
}

void loop() {
  // read from software serial, send to built in serial:
  if (SoftSerial.available()) {
    int inByte = SoftSerial.read();
    Serial.write(inByte);
  }

  // read from built in serial, send to software serial:
  if (Serial.available()) {
    int inByte = Serial.read();
    SoftSerial.write(inByte);
  }
}
My experience is that the software serial connection generally works OK, but can't be relied upon 100% of the time.  Some bytes (or whole strings of bytes) may come through as the wrong characters, which is why I suggested the better solution is to use a board with more than one hardware serial connection.

Still, the sketch above may meet the novice's needs for demonstrating the serial connection and testing out a few commands.  Wiring should be as follows:
  • Device TX to Arduino pin 2
  • Device RX to Arduino pin 3
  • Device GND to Arduino GND pin
If the device accepts 5V and current draw is within the limits of what can be supplied by the Arduino board, and powering from the Arduino is desired, then also connect
  • Device Vcc to Arduino 5V pin
Below shows an Arduino Uno running the sketch above connected to an Arduino MEGA2560 (clone) using multi serial.

Output is shown in the screen capture below.  


As can be seen, the Arduino Uno seems to send just fine, but its receiving leaves something to be desired.

Thursday, December 19, 2019

Getting game ROM files.

I have to start with a disclaimer, that downloading copyrighted material is illegal in many countries. Because of this, I can only condone using the Retrofoot/Pie Retro for playing games you have personally copied from your owned physical copies of the respective games. 

Since few people actually possess the hardware needed to do this, I am providing the following guidance for those who wish to disregard my warnings and venture into the vile world of content piracy. Seeking illegal files may take you to some places on the internet that might serve content that some people might find offensive or otherwise distasteful. Also, from time to time what once were reliable sources get legal pressure applied causing them to shutdown or stop hosting the game ROM files. So the intrepid neophyte content pirate is better served by teaching how to find what is wanted rather than providing links.

Finding just about any given game is usually a matter of asking the right question.  For example, typing "SNES ROMS download" into Google gives the first search result containing what appears to be ~1400 ROM files for games played with Super Nintendo Entertainment System, along with many more systems, each with a library of games. On sites like these, the game file (ROM) was compressed into a zip file.

So, as an example, if you want to play T&C Surf Design you might google search for "T&C Surf Design ROM," download, unzip the downloaded file and put the game into the right folder on a USB drive that has been prepared according to the instructions elsewhere on my blog. 

Some people don't have the patience to download games one at a time, and might find it easier to find an entire library using peer to peer (P2P) file sharing. This requires a piece of software called a p2p client.  There are many available for free.  If you prefer to use P2P, you might want to do a google search for something like "SNES ROMS torrent" the disclaimer above applies here as well.

Wednesday, September 20, 2017

Retro Foot/Pie Retro setup instructions for wired USB SNES controller BYOSD version

The Retro Pi is fairly straightforward to use, but these instruction may help if any problems
are encountered.

Imaging the micro SD card:
 Check the manufacturer and product number of your micro SD card on
http://elinux.org/Rpi_SD_cards and confirm that it is compatible with Raspberry Pi 3.  Cards that work are highlighted green, cards that don't are highlighted red.  Not all cards have been tested.
 CONTACT ME TO GET A PRECONFIGURED RETROPIE IMAGE (via ebay
messaging or by email at westwoodtoys@gmail.com), stating your preference in method
for file transfer. I can provide a google drive download link or torrent file. When you
have received the image file, substitute it for the file mentioned in the instructions linked
below.
 Read and understand the instructions at https://github.com/retropie/retropie-setup/wiki/First-Installation first, then follow the instructions, substituting the image I have preconfigured (that you downloaded above) for the base image referenced in the instructions.

Wiring:
This order matters. When the Retro Foot is supplied power it attempts to determine where to
send the video signal. If the hdmi is not plugged in and tv on it may assume it is supposed to be
working in ‘headless’ (no display) mode.
 Plug in the HDMI cable to the HDMI port on the Retro Pi, and connect the other end
to an HDMI port on your TV.
 Plug in the controllers to the Left Top and Bottom USB ports on the Retro Pi
 Plug the USB AC adapter into a wall outlet, plug the USB cord Type A (rectangular)
end into the AC adapter.
 Turn on the TV, tuned to the HDMI input you plugged the HDMI cable into and plug
in the micro USB (small, trapezoidal) end of the USB cord into the micro USB port
on the Retro Pi.
o If nothing happens, toggle the switch on the power cord.
o When plugged in you can see a couple LEDs shining through the vent on the
side.  When it is working right the red and green will both be illuminated; when
it isn't working the red may be on but not green.

Before Games are Loaded:
 If things are going correctly, when the micro USB cord is plugged in four raspberries
will be displayed in the upper left corner of the screen, followed by some computer
script, a 'Retropie' splash screen, a bit more script, an 'Emulation Station' splash
screen, and finally the Retro Pi main interface.
o You may be prompted to configure the controller.  Follow on-screen prompts to
configure the buttons.
 Minecraft and Kodi are listed under the ‘Ports’ heading.
o Kodi can be controlled by the gamepad or a USB mouse.
o Minecraft requires USB keyboard and mouse.

Loading Games:
 You will need a USB thumb drive formatted in FAT 32 file system.
 Create a folder named “retropie” at the highest directory level of the thumb drive (i.e.
if you are using a windows computer the folder will be “x:\retropie” where x is
whichever drive letter the thumb drive is assigned)
 Insert the thumb drive into any free USB port on the Retro Pi while the Retro Pi is
powered on and the main RetroPie interface screen is displayed.
 Wait a moment (many thumb drives have a light that blinks while file transfers are
active, other thumb drives have a light the pulses when it is inserted, but blinks
rapidly while actively transferring files; if equipped, wait until the light is no longer
blinking) while the Retro Pi creates folders within the ‘retropie’ folder for roms,
configs and BIOS. The ‘roms’ folder has subfolders for each game system emulator.
This process takes a couple minutes.
 Procure ROMs (game files are called ROMs) for the games you want to play.
o If the games are in .zip, .rar or any other compressed form, extract the ROM
files using your favorite file compression application
o As example, ROMs for the Nintendo Entertainment System have file extension
.nes
 Copy the ROMs into the subfolder for the system they are played with (i.e. games
played on the Nintendo Entertainment System go in the folder ‘retropie\roms\nes’ on
the thumb drive
 Once ROMs are loaded on the thumb drive, plug the thumb drive back into the Retro
Pi while it is powered on and the main RetroPie interface is displayed.
 Wait a little while for the files to transfer. Again, if there is a light on the thumb drive
that indicates file transfers are active you are waiting for the indication to stop. The
time this takes depends on how many files you are transferring.
 Reboot the Retro Foot. To minimize chance of corrupting the SD card image, when
rebooting/shutting down:
o From the main interface open the menu by pressing start
o Select ‘quit’
o Select ‘reboot’/’shutdown the system’
o Confirm that you want to reboot/shutdown
o If shutting down, you may now unplug the micro USB cable. Plug it back in
when you want to start up again.
 Upon returning to the RetroPie main interface screen you will now see additional
options besides ‘Ports’ when scrolling left or right from the ‘RetroPie’ option.

Once ROMs are loaded:
 On the main interface you can use either USB controller to select the emulator for
whichever system you want to use by pressing left or right on the controller 'D' pad,
and pushing the 'A' button.
 You will find a list of games you had on the thumb drive. Select the game you want
to play by pressing the ‘A’ button.
 If you get tired of one game while playing you can press 'start' and 'select' at the same
time to exit from that game.
 If you would like to download box art and game summaries you can try using one of
the scrapers from the options menu. You will need to configure wifi or plug in a LAN
connection. The scraping process is imperfect and can be tedious.

Instructions for enabling additional functionality (wifi, for example) are available at
https://github.com/retropie/

Remedial Troubleshooting:
Have you tried turning it off and back on?
 If only the red LED illuminates when powering on the system, make sure the SD card is
well seated and that the HDMI cable is plugged in as far as it will go.
 If subfolders don’t appear in the retropie folder or ROMs don’t load: Check that the
thumb drive is formatted in FAT32 file structure. Instructions for checking can be found
at https://esupport.sony.com/US/perl/support-info.pl?info_id=779. IF YOU NEED TO
REFORMAT, AND THERE ARE FILES ON THE DRIVE YOU DON'T WANT TO
LOSE, SAVE THEM ELSEWHERE BEFORE FORMATTING!
 If not all ROMs loaded: You may have rebooted before all ROMs were transferred, or
you may be out of storage space.

Advanced Troubleshooting:
Re-imaging the SD card by following the steps in the first section should fix any problem that isn't caused by bad hardware.

Retro Foot/Pie Retro setup instructions for wired USB SNES controller 4 or 8gb SD version

The Retro Pi is fairly straightforward to use, but these instruction may help if any problems
are encountered.

Wiring:
This order matters. When the Retro Foot is supplied power it attempts to determine where to
send the video signal. If the hdmi is not plugged in and tv on it may assume it is supposed to be
working in ‘headless’ (no display) mode.
 Plug in the HDMI cable to the HDMI port on the Retro Pi, and connect the other end
to an HDMI port on your TV.
 Plug in the controllers to the Left Top and Bottom USB ports on the Retro Pi
 Plug the USB AC adapter into a wall outlet, plug the USB cord Type A (rectangular)
end into the AC adapter.
 Turn on the TV, tuned to the HDMI input you plugged the HDMI cable into and plug
in the micro USB (small, trapezoidal) end of the USB cord into the micro USB port
on the Retro Pi.
o If nothing happens, toggle the switch on the power cord.
o When plugged in you can see a couple LEDs shining through the vent on the
side.  When it is working right the red and green will both be illuminated; when
it isn't working the red may be on but not green.

Before Games are Loaded:
 If things are going correctly, when the micro USB cord is plugged in four raspberries
will be displayed in the upper left corner of the screen, followed by some computer
script, a 'Retropie' splash screen, a bit more script, an 'Emulation Station' splash
screen, and finally the Retro Pi main interface.
o You may be prompted to configure the controller.  Follow on-screen prompts to
configure the buttons.
 Minecraft and Kodi are listed under the ‘Ports’ heading.
o Kodi can be controlled by the gamepad or a USB mouse.
o Minecraft requires USB keyboard and mouse.

Loading Games:
 You will need a USB thumb drive formatted in FAT 32 file system.
 Create a folder named “retropie” at the highest directory level of the thumb drive (i.e.
if you are using a windows computer the folder will be “x:\retropie” where x is
whichever drive letter the thumb drive is assigned)
 Insert the thumb drive into any free USB port on the Retro Pi while the Retro Pi is
powered on and the main RetroPie interface screen is displayed.
 Wait a moment (many thumb drives have a light that blinks while file transfers are
active, other thumb drives have a light the pulses when it is inserted, but blinks
rapidly while actively transferring files; if equipped, wait until the light is no longer
blinking) while the Retro Pi creates folders within the ‘retropie’ folder for roms,
configs and BIOS. The ‘roms’ folder has subfolders for each game system emulator.
This process takes a couple minutes.
 Procure ROMs (game files are called ROMs) for the games you want to play.
o If the games are in .zip, .rar or any other compressed form, extract the ROM
files using your favorite file compression application
o As example, ROMs for the Nintendo Entertainment System have file extension
.nes
 Copy the ROMs into the subfolder for the system they are played with (i.e. games
played on the Nintendo Entertainment System go in the folder ‘retropie\roms\nes’ on
the thumb drive
 Once ROMs are loaded on the thumb drive, plug the thumb drive back into the Retro
Pi while it is powered on and the main RetroPie interface is displayed.
 Wait a little while for the files to transfer. Again, if there is a light on the thumb drive
that indicates file transfers are active you are waiting for the indication to stop. The
time this takes depends on how many files you are transferring.
 Reboot the Retro Foot. To minimize chance of corrupting the SD card image, when
rebooting/shutting down:
o From the main interface open the menu by pressing start
o Select ‘quit’
o Select ‘reboot’/’shutdown the system’
o Confirm that you want to reboot/shutdown
o If shutting down, you may now unplug the micro USB cable. Plug it back in
when you want to start up again.
 Upon returning to the RetroPie main interface screen you will now see additional
options besides ‘Ports’ when scrolling left or right from the ‘RetroPie’ option.

Once ROMs are loaded:
 On the main interface you can use either USB controller to select the emulator for
whichever system you want to use by pressing left or right on the controller 'D' pad,
and pushing the 'A' button.
 You will find a list of games you had on the thumb drive. Select the game you want
to play by pressing the ‘A’ button.
 If you get tired of one game while playing you can press 'start' and 'select' at the same
time to exit from that game.
 If you would like to download box art and game summaries you can try using one of
the scrapers from the options menu. You will need to configure wifi or plug in a LAN
connection. The scraping process is imperfect and can be tedious.

Instructions for enabling additional functionality (wifi, for example) are available at
https://github.com/retropie/

Remedial Troubleshooting:
Have you tried turning it off and back on?
 If only the red LED illuminates when powering on the system, make sure the SD card is
well seated and that the HDMI cable is plugged in as far as it will go.
 If subfolders don’t appear in the retropie folder or ROMs don’t load: Check that the
thumb drive is formatted in FAT32 file structure. Instructions for checking can be found
at https://esupport.sony.com/US/perl/support-info.pl?info_id=779. IF YOU NEED TO
REFORMAT, AND THERE ARE FILES ON THE DRIVE YOU DON'T WANT TO
LOSE, SAVE THEM ELSEWHERE BEFORE FORMATTING!
 If not all ROMs loaded: You may have rebooted before all ROMs were transferred, or
you may be out of storage space.

Advanced Troubleshooting:
A separate computer able to read and write to a micro SD card (whether with an SD card adapter
or USB adapter doesn’t matter) and a USB keyboard are needed for advanced troubleshooting
steps. The Retro Foot needs to have an internet connection (whether via Ethernet or wifi doesn’t
matter).
 Read and understand https://github.com/retropie/retropie-setup/wiki/First-Installation, but
don’t follow the steps until you’ve read the step below.
 IF YOU BELIEVE YOU NEED TO REIMAGE YOUR SD CARD, PLEASE
CONTACT ME FIRST. I can provide a preconfigured image rather than the base image
found at retropie.org.uk referenced in the link, which will spare the effort of
reconfiguring controllers, and reloading the extras (Kodi, etc). Follow the instructions in
the First-Installation page above, substituting the image provided for the one they refer
to.

Retro Foot/Pie Retro setup instructions for wired USB PS2 controller 32gb SD version

The RetroPie is fairly straightforward to use, but these instruction may help if any problems
are encountered.

Wiring:
 Plug in the HDMI cable to the HDMI port on the RetroPie, and connect the other end
to an HDMI port on your TV.
 Plug in the controllers to the Left Top and Bottom USB ports on the RetroPie
 Plug the USB AC adapter into a wall outlet, plug the USB cord Type A (rectangular)
end into the AC adapter.
 Turn on the TV, tuned to the HDMI input you plugged the HDMI cable into and plug
in the micro USB (small, trapezoidal) end of the USB cord into the micro USB port
on the RetroPie.
o If nothing happens, toggle the button on the power cord.
o When plugged in you can see a couple LEDs shining through the vent on the
side.  When it is working right the red and green will both be illuminated; when
it isn't working the red may be on but not green.

Before Games are Loaded:
 If things are going correctly, when the micro USB cord is plugged in four raspberries
will be displayed in the upper left corner of the screen, followed by some computer
script, a 'Retropie' splash screen, a bit more script, an 'Emulation Station' splash
screen, and finally the RetroPie main interface.
o Make sure to press the analog button on the controller to enable the analog
joysticks
o You may be prompted to configure the controller.  Follow on-screen prompts to
configure the buttons.
 Minecraft and Kodi are listed under the ‘Ports’ heading.
o Kodi can be controlled by the gamepad or a USB mouse.
o Minecraft requires USB keyboard and mouse.

Loading Games:
 You will need a USB thumb drive formatted in FAT 32 file system.
 Create a folder named “retropie” at the highest directory level of the thumb drive (i.e.
if you are using a windows computer the folder will be “x:\retropie” where x is
whichever drive letter the thumb drive is assigned)
 Insert the thumb drive into any free USB port on the RetroPie while the RetroPie is
powered on and the main RetroPie interface screen is displayed.
 Wait a moment (many thumb drives have a light that blinks while file transfers are
active, other thumb drives have a light the pulses when it is inserted, but blinks
rapidly while actively transferring files; if equipped, wait until the light is no longer
blinking) while the RetroPie creates folders within the ‘retropie’ folder for roms,

configs and BIOS. The ‘roms’ folder has subfolders for each game system emulator.
This process takes a couple minutes.
 Procure ROMs (game files are called ROMs) for the games you want to play.
o If the games are in .zip, .rar or any other compressed form, extract the ROM
files using your favorite file compression application
o As example, ROMs for the Nintendo Entertainment System have file extension
.nes

 Copy the ROMs into the subfolder for the system they are played with (i.e. games
played on the Nintendo Entertainment System go in the folder ‘retropie\roms\nes’ on
the thumb drive
 Once ROMs are loaded on the thumb drive, plug the thumb drive back into the
RetroPie while it is powered on and the main RetroPie interface is displayed.
 Wait a little while for the files to transfer. Again, if there is a light on the thumb drive
that indicates file transfers are active you are waiting for the indication to stop. The
time this takes depends on how many files you are transferring.
 Reboot the RetroPie. To minimize chance of corrupting the SD card image, when
rebooting/shutting down:
o From the main interface open the menu by pressing start
o Select ‘quit’
o Select ‘reboot’/’shutdown the system’
o Confirm that you want to reboot/shutdown
o If shutting down, you may now unplug the micro USB cable. Plug it back in
when you want to start up again.

 Upon returning to the RetroPie main interface screen you will now see additional
options besides ‘Ports’ when scrolling left or right from the ‘RetroPie’ option.

Once ROMs are loaded:
 On the main interface you can use either USB controller to select the emulator for
whichever system you want to use by pressing left or right on the controller &#39;D&#39; pad,
and pushing the 'A' button.
 You will find a list of games you had on the thumb drive. Select the game you want
to play by pressing the ‘A’ button.
 If you get tired of one game while playing you can press 'start' and 'select' at the same
time to exit from that game.
 If you would like to download box are and game summaries you can try using one of
the scrapers from the options menu. You will need to configure wifi or plug in a LAN
connection. The scraping process is imperfect and can be tedious.

Instructions for enabling additional functionality (wifi, for example) are available at
https://github.com/retropie/

Remedial Troubleshooting:
Have you tried turning it off and back on?
 If only the red LED illuminates when powering on the system, make sure the SD card is
well seated and that the HDMI cable is plugged in as far as it will go.
 If subfolders don’t appear in the retropie folder or ROMs don’t load: Check that the
thumb drive is formatted in FAT32 file structure. Instructions for checking can be found
at https://esupport.sony.com/US/perl/support-info.pl?info_id=779. IF YOU NEED TO
REFORMAT, AND THERE ARE FILES ON THE DRIVE YOU DON'T WANT TO
LOSE, SAVE THEM ELSEWHERE BEFORE FORMATTING!
 If not all ROMs loaded: You may have rebooted before all ROMs were transferred, or
you may be out of storage space.

Advanced Troubleshooting:
A separate computer able to read and write to a micro SD card (whether with an SD card adapter
or USB adapter doesn’t matter) and a USB keyboard are needed for advanced troubleshooting
steps. The Retro Foot needs to have an internet connection (whether via Ethernet or wifi doesn’t
matter).
 Read and understand https://github.com/retropie/retropie-setup/wiki/First-Installation, but
don’t follow the steps until you’ve read the step below.
 IF YOU BELIEVE YOU NEED TO REIMAGE YOUR SD CARD, PLEASE
CONTACT ME FIRST. I can provide a preconfigured image rather than the base image
found at retropie.org.uk referenced in the link, which will spare the effort of
reconfiguring controller drivers, and reloading the extras (Kodi, etc). Follow the
instructions in the First-Installation page above, substituting the image provided for the
one they refer to.