Skip to content
Merged
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
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@

### Added

- FTP over TLS support ([#3](https://github.com/matth-x/MicroOcppMongoose/pull/3))
- ~FTP over TLS support ([#3](https://github.com/matth-x/MicroOcppMongoose/pull/3))~ (see [#5](https://github.com/matth-x/MicroOcppMongoose/pull/5))

### Removed

- FTP moved into a new project [MicroFtp](https://github.com/matth-x/MicroFtp) ([#5](https://github.com/matth-x/MicroOcppMongoose/pull/5))

## [1.0.0] - 2023-10-20

Expand Down
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ cmake_minimum_required(VERSION 3.15)
set(MO_MG_SRC
src/MicroOcppMongooseClient_c.cpp
src/MicroOcppMongooseClient.cpp
src/MicroOcppMongooseFtp.cpp
)

if(ESP_PLATFORM)
Expand Down
45 changes: 0 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,51 +21,6 @@ The setup is done if the following include statements work:

The last dependency is [base64-converter by Densaugeo](https://github.com/Densaugeo/base64_arduino), but it is already included in this repository. Thanks to [Densaugeo](https://github.com/Densaugeo) for providing it!

## Additional FTP(s) Client

This library also contains an experimental FTP client based on Mongoose. Its intended use is to download firmware binaries and to upload hardware diagnostics information as part of the OCPP UpdateFirmware / GetDiagnostics operations.

Currently, the compatibility with the following FTP servers has been tested:

| Server | FTP | FTPS |
| --- | --- | --- |
| [vsftp](https://security.appspot.com/vsftpd.html) | ✔️ | ✔️ |
| [Pure-FTPd](https://www.pureftpd.org/project/pure-ftpd/) | ✔️ | |
| [Rebex](https://www.rebex.net/) | ✔️ | ✔️ |

The following code snippet shows how to use the FTP client:

```cpp
struct mg_mgr mgr;
//initialize mgr

MicroOcpp::MongooseFtpClient ftp {&mgr};

if (/* test FTP download */) {
ftp.getFile("ftps://ftpuser:secret123@ftp.example.com/dir/firmware.bin",
[] (unsigned char *data, size_t len) -> size_t {
//write firmware data on flash
return len;
}, [] () {
//finalize OTA update
});

} else if (/* test FTP upload */) {
ftp.postFile("ftps://ftpuser:secret123@ftp.example.com/dir/diagnostics.log",
[] (unsigned char *data, size_t len) -> size_t {
//write diagnostics text to `data` having length `len`
return /* written */; //return number of bytes actually written to data (if 0, upload will be finished)
}, [] () {
//connection close callback
});
}

for (;;) {
mg_mgr_poll(&mgr, 100);
ftp.loop(); //only necessary for Mongoose v6
}
```

## License

This project is licensed under the GPL as it uses the [Mongoose Embedded Networking Library](https://github.com/cesanta/mongoose). If you have a proprietary license of Mongoose, then the [MIT License](https://github.com/matth-x/MicroOcpp/blob/master/LICENSE) applies.
Loading