Skip to content

Commit 0ac4b49

Browse files
authored
FTP moved into new project (#5)
1 parent 3802fd2 commit 0ac4b49

File tree

5 files changed

+5
-870
lines changed

5 files changed

+5
-870
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44

55
### Added
66

7-
- FTP over TLS support ([#3](https://github.com/matth-x/MicroOcppMongoose/pull/3))
7+
- ~FTP over TLS support ([#3](https://github.com/matth-x/MicroOcppMongoose/pull/3))~ (see [#5](https://github.com/matth-x/MicroOcppMongoose/pull/5))
8+
9+
### Removed
10+
11+
- FTP moved into a new project [MicroFtp](https://github.com/matth-x/MicroFtp) ([#5](https://github.com/matth-x/MicroOcppMongoose/pull/5))
812

913
## [1.0.0] - 2023-10-20
1014

CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ cmake_minimum_required(VERSION 3.15)
77
set(MO_MG_SRC
88
src/MicroOcppMongooseClient_c.cpp
99
src/MicroOcppMongooseClient.cpp
10-
src/MicroOcppMongooseFtp.cpp
1110
)
1211

1312
if(ESP_PLATFORM)

README.md

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -21,51 +21,6 @@ The setup is done if the following include statements work:
2121

2222
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!
2323

24-
## Additional FTP(s) Client
25-
26-
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.
27-
28-
Currently, the compatibility with the following FTP servers has been tested:
29-
30-
| Server | FTP | FTPS |
31-
| --- | --- | --- |
32-
| [vsftp](https://security.appspot.com/vsftpd.html) | ✔️ | ✔️ |
33-
| [Pure-FTPd](https://www.pureftpd.org/project/pure-ftpd/) | ✔️ | |
34-
| [Rebex](https://www.rebex.net/) | ✔️ | ✔️ |
35-
36-
The following code snippet shows how to use the FTP client:
37-
38-
```cpp
39-
struct mg_mgr mgr;
40-
//initialize mgr
41-
42-
MicroOcpp::MongooseFtpClient ftp {&mgr};
43-
44-
if (/* test FTP download */) {
45-
ftp.getFile("ftps://ftpuser:secret123@ftp.example.com/dir/firmware.bin",
46-
[] (unsigned char *data, size_t len) -> size_t {
47-
//write firmware data on flash
48-
return len;
49-
}, [] () {
50-
//finalize OTA update
51-
});
52-
53-
} else if (/* test FTP upload */) {
54-
ftp.postFile("ftps://ftpuser:secret123@ftp.example.com/dir/diagnostics.log",
55-
[] (unsigned char *data, size_t len) -> size_t {
56-
//write diagnostics text to `data` having length `len`
57-
return /* written */; //return number of bytes actually written to data (if 0, upload will be finished)
58-
}, [] () {
59-
//connection close callback
60-
});
61-
}
62-
63-
for (;;) {
64-
mg_mgr_poll(&mgr, 100);
65-
ftp.loop(); //only necessary for Mongoose v6
66-
}
67-
```
68-
6924
## License
7025

7126
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.

0 commit comments

Comments
 (0)