Merge branch 'wellenvogel:master' into master
This commit is contained in:
commit
b1bdc6ac7b
18
Readme.md
18
Readme.md
|
@ -76,13 +76,20 @@ You can find a prebuild executable in tools: [esptool.exe](tools/esptool.exe).
|
||||||
Just create an empty directory on your machine, download the esptool to this directory and also download the binary (xxx-all.bin) from [releases](../../releases).
|
Just create an empty directory on your machine, download the esptool to this directory and also download the binary (xxx-all.bin) from [releases](../../releases).
|
||||||
Afterwards you need to install the driver for the serial port to connect your ESP32 board. For a modern windows the driver at [FTDI](https://ftdichip.com/drivers/d2xx-drivers/) should be working.
|
Afterwards you need to install the driver for the serial port to connect your ESP32 board. For a modern windows the driver at [FTDI](https://ftdichip.com/drivers/d2xx-drivers/) should be working.
|
||||||
After installing the driver check with your device manager for the com port that is assigned to your connected esp device.
|
After installing the driver check with your device manager for the com port that is assigned to your connected esp device.
|
||||||
|
|
||||||
Open a command prompt and change into the directory you downloaded the esptool.exe and the firmware binary.
|
Open a command prompt and change into the directory you downloaded the esptool.exe and the firmware binary.
|
||||||
Flash with the command
|
Flash with the command
|
||||||
```
|
```
|
||||||
esptool.exe --port COM3 write_flash 0x1000 xxxxx-xxxx-all.bin
|
esptool.exe --port COM3 write_flash 0x1000 xxxxx-xxxx-all.bin
|
||||||
```
|
```
|
||||||
Replace COM3 with the port shown in the device manager and the xxx with the name of the downloaded binary.
|
Replace COM3 with the port shown in the device manager and the xxx with the name of the downloaded binary.
|
||||||
If you do not want to use the command line you first need to install python3 from the [download page](https://www.python.org/downloads/windows/) - use the Windows 64 Bit installer. Install using the default settings. Afterwards download [flashtool.pyz](../../raw/master/tools/flashtool.pyz) and run it with a double click.
|
|
||||||
|
If you do not want to use the command line there is a tool with an UI that allows you to flash the initial or update firmware.
|
||||||
|
Just download the exe for your windows system from the [ESP32N2K-Flasher Git Repository](https://github.com/wellenvogel/esp32n2k-flasher/releases/latest).
|
||||||
|
There is no installation needed - just start the downloaded exe.
|
||||||
|
Some Anti Virus Software may (accidently) tag this as infected. In this case you can still install the UI in two steps:
|
||||||
|
* you first need to install python3 from the [download page](https://www.python.org/downloads/windows/) - use the Windows 64 Bit installer. Install using the default settings.
|
||||||
|
* Afterwards download [flashtool.pyz](../../raw/master/tools/flashtool.pyz) and run it with a double click.
|
||||||
|
|
||||||
|
|
||||||
Update
|
Update
|
||||||
|
@ -131,6 +138,15 @@ For details refer to the [example description](lib/exampletask/Readme.md).
|
||||||
|
|
||||||
Changelog
|
Changelog
|
||||||
---------
|
---------
|
||||||
|
[20220107](../../releases/tag/20220107)
|
||||||
|
********
|
||||||
|
* add a TCP client - you can connect to any source of NMEA data using IP address (or MDNS host name) and port<br>
|
||||||
|
This way you can e.g. "chain" multiple gateways
|
||||||
|
* add receiving of Seasmart messages.<br>
|
||||||
|
Using this feature you can forward the data from the NMEA2000 bus via TCP to another device.
|
||||||
|
* add some Status Info to the extension API
|
||||||
|
* correct the display of wind direction on the data page
|
||||||
|
|
||||||
[20211218](../../releases/tag/20211218)
|
[20211218](../../releases/tag/20211218)
|
||||||
********
|
********
|
||||||
* 1st real release
|
* 1st real release
|
||||||
|
|
|
@ -4,39 +4,51 @@
|
||||||
#include "GwSocketServer.h"
|
#include "GwSocketServer.h"
|
||||||
#include "GwSerial.h"
|
#include "GwSerial.h"
|
||||||
#include "GwTcpClient.h"
|
#include "GwTcpClient.h"
|
||||||
class GwSerialLog : public GwLogWriter{
|
class GwSerialLog : public GwLogWriter
|
||||||
|
{
|
||||||
static const size_t bufferSize = 4096;
|
static const size_t bufferSize = 4096;
|
||||||
char *logBuffer = NULL;
|
char *logBuffer = NULL;
|
||||||
int wp = 0;
|
int wp = 0;
|
||||||
GwSerial *writer;
|
GwSerial *writer;
|
||||||
|
bool disabled = false;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GwSerialLog(GwSerial *writer){
|
GwSerialLog(GwSerial *writer, bool disabled)
|
||||||
|
{
|
||||||
this->writer = writer;
|
this->writer = writer;
|
||||||
|
this->disabled = disabled;
|
||||||
logBuffer = new char[bufferSize];
|
logBuffer = new char[bufferSize];
|
||||||
wp = 0;
|
wp = 0;
|
||||||
}
|
}
|
||||||
virtual ~GwSerialLog() {}
|
virtual ~GwSerialLog() {}
|
||||||
virtual void write(const char *data){
|
virtual void write(const char *data)
|
||||||
|
{
|
||||||
|
if (disabled)
|
||||||
|
return;
|
||||||
int len = strlen(data);
|
int len = strlen(data);
|
||||||
if ((wp+len) >= (bufferSize-1)) return;
|
if ((wp + len) >= (bufferSize - 1))
|
||||||
|
return;
|
||||||
strncpy(logBuffer + wp, data, len);
|
strncpy(logBuffer + wp, data, len);
|
||||||
wp += len;
|
wp += len;
|
||||||
logBuffer[wp] = 0;
|
logBuffer[wp] = 0;
|
||||||
}
|
}
|
||||||
virtual void flush(){
|
virtual void flush()
|
||||||
|
{
|
||||||
size_t handled = 0;
|
size_t handled = 0;
|
||||||
while (handled < wp){
|
if (!disabled)
|
||||||
|
{
|
||||||
|
while (handled < wp)
|
||||||
|
{
|
||||||
writer->flush();
|
writer->flush();
|
||||||
size_t rt = writer->sendToClients(logBuffer + handled, -1, true);
|
size_t rt = writer->sendToClients(logBuffer + handled, -1, true);
|
||||||
handled += rt;
|
handled += rt;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
wp = 0;
|
wp = 0;
|
||||||
logBuffer[0] = 0;
|
logBuffer[0] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
GwChannelList::GwChannelList(GwLog *logger, GwConfigHandler *config){
|
GwChannelList::GwChannelList(GwLog *logger, GwConfigHandler *config){
|
||||||
this->logger=logger;
|
this->logger=logger;
|
||||||
this->config=config;
|
this->config=config;
|
||||||
|
@ -53,7 +65,7 @@ void GwChannelList::begin(bool fallbackSerial){
|
||||||
if (! fallbackSerial){
|
if (! fallbackSerial){
|
||||||
GwSerial *usb=new GwSerial(NULL,0,USB_CHANNEL_ID);
|
GwSerial *usb=new GwSerial(NULL,0,USB_CHANNEL_ID);
|
||||||
usb->setup(config->getInt(config->usbBaud),3,1);
|
usb->setup(config->getInt(config->usbBaud),3,1);
|
||||||
logger->setWriter(new GwSerialLog(usb));
|
logger->setWriter(new GwSerialLog(usb,config->getBool(config->usbActisense)));
|
||||||
logger->prefix="GWSERIAL:";
|
logger->prefix="GWSERIAL:";
|
||||||
channel=new GwChannel(logger,"USB",USB_CHANNEL_ID);
|
channel=new GwChannel(logger,"USB",USB_CHANNEL_ID);
|
||||||
channel->setImpl(usb);
|
channel->setImpl(usb);
|
||||||
|
|
|
@ -1224,7 +1224,7 @@ let valueFormatters = {
|
||||||
f: function (v) {
|
f: function (v) {
|
||||||
let x = parseFloat(v);
|
let x = parseFloat(v);
|
||||||
x = x * 180.0 / Math.PI;
|
x = x * 180.0 / Math.PI;
|
||||||
if (x > 180) x = 180 - x;
|
if (x > 180) x = -1 * (360 - x);
|
||||||
return x.toFixed(0);
|
return x.toFixed(0);
|
||||||
},
|
},
|
||||||
u: '°'
|
u: '°'
|
||||||
|
|
Loading…
Reference in New Issue