added input field for IP address

development
Thiemann96 5 years ago
parent d03b613cc7
commit f1ed71417b

@ -6,7 +6,7 @@
"BLOCKLY": "Blockly",
"DOCS": "Dokumentation",
"SETTINGS": "Einstellungen",
"MYSENSEBOX":"Meine senseBox"
"MYSENSEBOX": "Meine senseBox"
},
"ABOUT": {
"TITLE": "Über",
@ -26,24 +26,24 @@
"BTN_CODE": "Quellcode Ansicht",
"BTN_OTA": "OTA Upload"
},
"CONFIG":{
"WIFI":"WiFi Einstellungen",
"IDS":"senseBox und Sensor ID's",
"DEBUG":"Debugging einschalten",
"BUTTON":"Sketch hochladen!"
"CONFIG": {
"WIFI": "WiFi Einstellungen",
"IDS": "senseBox und Sensor ID's",
"DEBUG": "Debugging einschalten",
"BUTTON": "Sketch hochladen!"
},
"MYSENSEBOX":{
"TITLE":"Meine senseBox",
"SHOW":"Zeige Sensoren",
"SKETCH":"Sketch hochladen",
"EXPOSURE":"Position"
"MYSENSEBOX": {
"TITLE": "Meine senseBox",
"SHOW": "Zeige Sensoren",
"SKETCH": "Sketch hochladen",
"EXPOSURE": "Position"
},
"LOGIN":{
"LOADING":"Einloggen..."
"LOGIN": {
"LOADING": "Einloggen..."
},
"SENSORS":{
"TYP":"Typ",
"MEASUREMENT":"Letzte Messung"
"SENSORS": {
"TYP": "Typ",
"MEASUREMENT": "Letzte Messung"
},
"SETTINGS": {
"TITLE": "Einstellungen",
@ -63,7 +63,7 @@
"TITLE": "Over The Air Programmierung",
"BTN_NEXT": "Weiter",
"BTN_CLOSE": "Schließen",
"BTN_REQUEST":"OTA Modus aktivieren!",
"BTN_REQUEST": "OTA Modus aktivieren!",
"BTN_BACK": "Zurück",
"INTRO": {
"TITLE": "Willkommen",
@ -80,15 +80,16 @@
"STEP1": "halte den den 'Switch' Knopf (grau oder blau) gedrückt",
"STEP2": "drücke den roten 'Reset' Knopf einmal",
"STEP3": "lasse den 'Switch' Knopf nach einer Sekunde los.",
"AUTOMATIC":{
"STEP1":"Laden den Over-the-Air Sketch der openSenseMap auf die senseBox",
"STEP2":"Verbinde dich mit gleichen Netzwekr in dem die senseBox eingewählt ist",
"STEP3":"Klicke auf 'Weiter'!"
"AUTOMATIC": {
"STEP0": "IP Addresse der senseBox: ",
"STEP1": "Laden den Over-the-Air Sketch der openSenseMap auf die senseBox",
"STEP2": "Verbinde dich mit gleichen Netzwekr in dem die senseBox eingewählt ist",
"STEP3": "Klicke auf 'Weiter'!"
}
},
"OTAMODESELECTION":{
"AUTOMATIC":"Wähle diesen Modus wenn du den openSenseMap Sketch nach dem 20.03.2020 auf die senseBox hochgeladen hast!",
"MANUAL":"Wähle diesen Modus aus um die senseBox manuell in den OTA Modus zu schalten!"
"OTAMODESELECTION": {
"AUTOMATIC": "Wähle diesen Modus wenn du den openSenseMap Sketch nach dem 20.03.2020 auf die senseBox hochgeladen hast!",
"MANUAL": "Wähle diesen Modus aus um die senseBox manuell in den OTA Modus zu schalten!"
},
"COMPILATION": {
"COMPILING": {

@ -21,23 +21,23 @@
},
"HINT": "<em>Hint:</em> A <a href=\"https://blockly.sensebox.de\">web version of Blockly for senseBox</a> is available as well!"
},
"LOGIN":{
"LOADING":"Logging in..."
},
"LOGIN": {
"LOADING": "Logging in..."
},
"BLOCKLY": {
"TITLE": "Blockly for senseBox",
"BTN_CODE": "Code View",
"BTN_OTA": "OTA Programmer"
},
"MYSENSEBOX":{
"TITLE":"My senseBox",
"SHOW":"Show sensors",
"SKETCH":"Upload Sketch",
"EXPOSURE":"Exposure"
"MYSENSEBOX": {
"TITLE": "My senseBox",
"SHOW": "Show sensors",
"SKETCH": "Upload Sketch",
"EXPOSURE": "Exposure"
},
"SENSORS":{
"TYP":"Type",
"MEASUREMENT":"Last measurement"
"SENSORS": {
"TYP": "Type",
"MEASUREMENT": "Last measurement"
},
"SETTINGS": {
"TITLE": "Settings",
@ -58,7 +58,7 @@
"BTN_NEXT": "Continue",
"BTN_CLOSE": "Close",
"BTN_BACK": "Back",
"BTN_REQUEST":"Enable OTA Mode",
"BTN_REQUEST": "Enable OTA Mode",
"INTRO": {
"TITLE": "Welcome",
"TEXT": "To transfer your code to your senseBox over the air (OTA), please follow these steps.",
@ -74,15 +74,16 @@
"STEP1": "press &amp; hold the switch button (gray or blue)",
"STEP2": "press the red r eset button shortly",
"STEP3": "release the switch button after one second",
"AUTOMATIC":{
"STEP1":"Upload the Over-the-Air Sketch from the OpenSenseMap to the senseBox",
"STEP2":"Connect this device to the same network the senseBox is connected with",
"STEP3":"Click Continue!"
"AUTOMATIC": {
"STEP0": "IP Address of the senseBox: ",
"STEP1": "Upload the Over-the-Air Sketch from the OpenSenseMap to the senseBox",
"STEP2": "Connect this device to the same network the senseBox is connected with",
"STEP3": "Click Continue!"
}
},
"OTAMODESELECTION":{
"AUTOMATIC":"Choose this mode if your senseBox is currently running an OpenSenseMap Sketch acquired after 20.03.2020",
"MANUAL":"Choose this mode if you have uploaded the OTA Sketch"
"OTAMODESELECTION": {
"AUTOMATIC": "Choose this mode if your senseBox is currently running an OpenSenseMap Sketch acquired after 20.03.2020",
"MANUAL": "Choose this mode if you have uploaded the OTA Sketch"
},
"COMPILATION": {
"COMPILING": {
@ -122,11 +123,11 @@
"ERROR": "Error!"
}
},
"CONFIG":{
"TITLE":"Initial configuration",
"BUTTON":"Upload Sketch!",
"WIFI":"Configure WiFi Settings",
"IDS":"senseBox and sensor ID's",
"DEBUG":"Enable debugging"
"CONFIG": {
"TITLE": "Initial configuration",
"BUTTON": "Upload Sketch!",
"WIFI": "Configure WiFi Settings",
"IDS": "senseBox and sensor ID's",
"DEBUG": "Enable debugging"
}
}

@ -120,7 +120,11 @@
<ion-grid *ngIf="modus === 'automatic' ">
<ion-row align-items-center>
<ion-col col-12 col-md-6>
<ol style="text-align: left">
<ol style="text-align: left" start="0">
<li>
{{ 'OTAWIZ.OTAMODE.AUTOMATIC.STEP0' | translate }}
<input [(ngModel)]="OTAAddress" placeholder=" 'OTAWIZ.OTAMODE.AUTOMATIC.IPINPUT' | translate"/>
</li>
<li [innerHTML]="'OTAWIZ.OTAMODE.AUTOMATIC.STEP1' | translate"></li>
<li [innerHTML]="'OTAWIZ.OTAMODE.AUTOMATIC.STEP2' | translate"></li>
<li [innerHTML]="'OTAWIZ.OTAMODE.AUTOMATIC.STEP3' | translate"></li>

@ -52,6 +52,7 @@ export class OtaWizardPage implements OnInit, OnDestroy {
private slideHistory: string[] = [OtaSlides[OtaSlides.Intro]] // for debug info in logs
private counts = { compile: 0, connect: 0, upload: 0 }
private modus;
private OTAAddress = '192.168.0.46'
private wifiSlideHidden = false;
constructor(
private network: Network,
@ -136,12 +137,14 @@ export class OtaWizardPage implements OnInit, OnDestroy {
showAutomatic() {
this.hideSlide(OtaSlides.WifiSelection);
this.modus = "automatic";
this.OTAAddress = '192.168.0.46'
this.slides.lockSwipeToNext(false);
this.slides.slideNext()
}
showManual() {
this.modus = "manual";
this.OTAAddress = '192.168.1.1'
this.showSlide(this.slideWifi);
this.slides.lockSwipeToNext(false);
this.slides.slideNext()
@ -185,6 +188,7 @@ export class OtaWizardPage implements OnInit, OnDestroy {
}
get currentSlide(): OtaSlides {
console.log(this.OTAAddress);
let current = this.slides.getActiveIndex()
const hiddenOffset = this.hiddenSlides.filter(slide => slide <= current).length
if(current === 3 && this.slideIsHidden(this.slideWifi)){
@ -270,7 +274,7 @@ export class OtaWizardPage implements OnInit, OnDestroy {
this.state.upload = 'uploading'
try {
const res = await this.otaWifi.uploadFirmware(this.compiledSketch)
const res = await this.otaWifi.uploadFirmware(this.compiledSketch,this.OTAAddress)
this.log.debug(JSON.stringify(res, null, 2))
this.state.upload = 'done'

@ -68,9 +68,9 @@ export class OtaWifiProvider {
: WifiWizard2.connect(ssid, true) // true: bind to all connections, even without internet
}
async uploadFirmware (binary: ArrayBuffer): Promise<any> {
async uploadFirmware (binary: ArrayBuffer,OTAAddress:String): Promise<any> {
// TODO: send checksum?
return this.http.post(`${URL_sensebox}/sketch`, binary, {
return this.http.post(`${OTAAddress}/sketch`, binary, {
responseType: 'text',
})
.pipe(timeout(5000), catchError(err => {

Loading…
Cancel
Save