Skip to content

Commit

Permalink
v0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-ffm committed Apr 25, 2019
1 parent 414879e commit ce61861
Show file tree
Hide file tree
Showing 451 changed files with 74,227 additions and 0 deletions.
Binary file added esptool.exe
Binary file not shown.
32 changes: 32 additions & 0 deletions esptool.py.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# -*- mode: python -*-

block_cipher = None


a = Analysis(['C:\\Users\\Daniel\\AppData\\Local\\Programs\\Python\\Python37-32\\Scripts\\esptool.py.exe'],
pathex=['esptool'],
binaries=[],
datas=[],
hiddenimports=[],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
[],
name='esptool.py',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
runtime_tmpdir=None,
console=True )
32 changes: 32 additions & 0 deletions esptool.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# -*- mode: python -*-

block_cipher = None


a = Analysis(['C:\\Users\\Daniel\\AppData\\Local\\Programs\\Python\\Python37-32\\Lib\\site-packages\\esptool.py'],
pathex=['esptool'],
binaries=[],
datas=[],
hiddenimports=[],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
[],
name='esptool',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
runtime_tmpdir=None,
console=True )
15 changes: 15 additions & 0 deletions index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
body {
background-color: #1E1E1F;
font-family: monospace;
color: white;
}
button {
background-color: #701616;
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
}
103 changes: 103 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
<!DOCTYPE html>
<html>
<head>
<title>INAV-Radar Installer v0.1</title>
<link rel="stylesheet" href="index.css">
<script src="jquery-3.4.0.js"></script>
</head>
<body>
<div id="choose">
<center>
<span>This installer flashes the last INAV-Radar release from Github.</span><br>
<span>Please connect a ESP32-LoRa module and</span><br>
<span>choose the version you want to flash: </span><br>
<button onclick="getLastRelease('433')">433 MHz</button>
<button onclick="getLastRelease('868')">868 MHz</button>
<button onclick="getLastRelease('915')">915 MHz</button>
<center>
</div>
<div id="status" style="display:none;">
<center>

<span id="download">Download last release ...</span><br>
<span id="serial" style="display:none;">ESP32 module connected at: </span><br>
<span id="flash" style="display:none;">Flashing ...</span><br>
<pre id="output" style="display:none;"></pre>
<center>
</div>
</body>
<script type="text/javascript">
var downloadRelease = require('download-github-release');
var path = require('path');
var user = 'mistyk';
var repo = 'inavradar-ESP32';
var outputdir = path.resolve('.');
var leaveZipped = false;
function getLastRelease (mhz) {
$('#choose').hide();
$('#status').show();
// Define a function to filter releases.
function filterRelease(release) {
// Filter out prereleases.
return release.prerelease === true;
}

// Define a function to filter assets.
function filterAsset(asset) {
// Select assets that contain the string 'windows'.
return asset.name.indexOf('air-to-air-' + mhz) >= 0;
}

downloadRelease(user, repo, outputdir, filterRelease, filterAsset, leaveZipped)
.then(function() {
whichPort();
})
.catch(function(err) {
console.error(err.message);
});
}
function whichPort () {
chrome.serial.getDevices(function(ports) {
for (let port of ports) {
if (port.vendorId) {
console.log(port);
$('#serial').show();
$('#serial').append(port.path);
flash(port.path);
}
}
});
}
function flash (port) {
$('#flash').show();
$('#output').show();
var spawn = require('child_process').spawn;
var child = spawn('esptool.exe',
['--port', port, 'write_flash', '-z', '--flash_mode', 'dio', '0x1000', 'air-to-air\\bootloader_dio_40m.bin', '0x8000', 'air-to-air\\default.bin', '0xe000', 'air-to-air\\boot_app0.bin', '0x10000', 'air-to-air\\firmware.bin', '0x291000', 'air-to-air\\fs.bin']
);
child.stdout.on('data',function (err) {
var out = String.fromCharCode.apply(null,err)
if (out.search('Writing at') != -1) {
$('#output').append('.');
}
if (out.search('Wrote') != -1) {
$('#output').append('\n' + out);
}
if (out.search('Wrote') == -1 && out.search('Writing at') == -1) {
$('#output').append(out);
}
});
child.stderr.on('data',function (err) {
$('#output').append( String.fromCharCode.apply(null,err));
});
child.on('close', function () {
$('#choose').show();
$('#status').hide();
$('#flash').hide();
$('#output').hide();
$('#output').innerHTML('');
})

}
</script>
</html>
Loading

0 comments on commit ce61861

Please sign in to comment.