Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions ROMULATOR_STANDALONE.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,8 @@ At this point, your standalone programmer is ready to go. Connect the D1 Mini to

Now you can power up, and wait for the blinking LED to stop blinking and be solidly on. This indicates that the board has successfully connected to your router and is now on your wifi network.

Here is one tricky part. The D1 Mini is supposed to be able to self-report a hostname, much like the raspberry pi does on your local network (raspberrypi.local). This would be convenient, since you could refer to this address rather than needing to know the local IP that your router happens to assign to the device. However, I was not able to get this to work, despite trying sample code exactly which claimed to do this. Possibly a router misconfiguration on my part. Feel free to let me know if you have any insights on this.\
For this reason, I added a simple redirect service hosted on my site, bitfixer.com.\
Once the D1 Mini successfully connects to your network, it makes a single request to http://bitfixer.com/rmltr/r.php. Included in this request is the local IP address the device was given by your router.\
After your D1 Mini connects, you can then reach its web interface by going here:\
[http://bitfixer.com/myromulator](http://bitfixer.com/myromulator)\
This reads the IP of the incoming request, which will match the IP of the D1 Mini since they are on the same network, and will redirect you back to the D1 Mini's local IP. This allows you to reach the web interface without knowing the specific local IP.\
Your device should be reachable now under <http://romulator.local> .

You can also just check the local IP of the device on your router as well and connect directly to it, either method works.

Once connected to the web interface, you can program the ROMulator with the firmware you built, which will be in bin/romulator.bin in the bf-romulator directory. Just select 'Program' on the webpage and then select this file, and wait until the upload and programming completes. That's it!
Expand Down
5 changes: 5 additions & 0 deletions romulator-programmer-debugger/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.pio
.vscode/.browse.c_cpp.db*
.vscode/c_cpp_properties.json
.vscode/launch.json
.vscode/ipch
10 changes: 10 additions & 0 deletions romulator-programmer-debugger/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"platformio.platformio-ide"
],
"unwantedRecommendations": [
"ms-vscode.cpptools-extension-pack"
]
}
32 changes: 19 additions & 13 deletions romulator-programmer-debugger/src/rServer.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "rServer.h"
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>
#include <Arduino.h>
#include <EEPROM.h>
#include <LittleFS.h>
Expand Down Expand Up @@ -354,18 +355,16 @@ void startServer()
digitalWrite(LED_PIN, LED_ON);
Serial.printf("connected, ip address %s\n", WiFi.localIP().toString().c_str());

// report local ip address to forwarding service
// this allows you to find your romulator on your local network easily
WiFiClient client;
HTTPClient http;
char url[256];
sprintf(url, "http://bitfixer.com/rmltr/r.php?ip=%s", WiFi.localIP().toString().c_str());

http.begin(client, url);
int httpCode = http.GET();
Serial.printf("recv %d\n", httpCode);
String payload = http.getString();
Serial.printf("payload: %s\n", payload.c_str());
// Set up mDNS responder:
// romulator.local
if (!MDNS.begin("romulator")){
Serial.println("Error setting up MDNS responder!");
while (1){
delay(1000);
}
}

Serial.println("mDNS responder started");
}

server.on("/", handlePortal);
Expand All @@ -385,6 +384,9 @@ void startServer()
server.begin();
Serial.println("HTTP server started.\n");

// Add service to MDNS-SD
MDNS.addService("http", "tcp", 80);

_lastMillis = millis();
}

Expand All @@ -408,6 +410,10 @@ void handleClient()
_lastMillis += 500;
}
}

else
{
MDNS.update();
}

server.handleClient();
}