Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
ICBM
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
detectors
DSSC
ICBM
Commits
8dfa3fa4
Commit
8dfa3fa4
authored
1 year ago
by
Cyril Danilevski
Browse files
Options
Downloads
Patches
Plain Diff
Use WiFi stack for networking
parent
301d2cac
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+6
-0
6 additions, 0 deletions
README.md
icbm.ino
+7
-7
7 additions, 7 deletions
icbm.ino
with
13 additions
and
7 deletions
README.md
+
6
−
0
View file @
8dfa3fa4
...
...
@@ -5,6 +5,12 @@ ESP32 firmware for the IMC, based on Arduino and the `ESP32-Ethernet-Kit_A_V1.2`
This project depends on
[
`Arduino_SNMP`
](
https://github.com/patricklaf/SNMP
)
.
### Quirks
Despite communication being over Ethernet, the project makes use of the ESP32 Wifi stack, hence some
references to Wifi here and there (eg.
`WiFiUdp`
).
### Installation
Either use the Arduino IDE and use its library manager to find the SNMP library, or use
`arduino-cli`
:
...
...
This diff is collapsed.
Click to expand it.
icbm.ino
+
7
−
7
View file @
8dfa3fa4
#include
<
Ethernet
Udp.h>
#include
<
WiFi
Udp.h>
#include
<SNMP.h>
#include
"esp32_ethernet.hpp"
Ethernet
UDP
udp
;
WiFi
UDP
udp
;
SNMP
::
Manager
snmp
;
// Use some SNMP classes
...
...
@@ -238,9 +238,9 @@ void setup() {
// Start
start
=
millis
();
// MPOD
//
SNMP::Message *message = mpod.setup();
//
snmp.send(message, IPAddress(10, 42, 0,
3
), SNMP::PORT::SNMP);
//
delete message;
SNMP
::
Message
*
message
=
mpod
.
setup
();
snmp
.
send
(
message
,
IPAddress
(
10
,
42
,
0
,
1
),
SNMP
::
PORT
::
SNMP
);
delete
message
;
}
enum
{
...
...
@@ -269,7 +269,7 @@ void loop() {
// If ON or OFF, send SETREQUEST to MPOD
SNMP
::
Message
*
message
=
mpod
.
output
(
output
==
ON
);
Serial
.
print
(
"Sending message "
);
snmp
.
send
(
message
,
IPAddress
(
10
,
42
,
0
,
3
),
SNMP
::
PORT
::
SNMP
);
snmp
.
send
(
message
,
IPAddress
(
10
,
42
,
0
,
1
),
SNMP
::
PORT
::
SNMP
);
Serial
.
println
(
"Sent"
);
delete
message
;
}
...
...
@@ -279,7 +279,7 @@ void loop() {
start
=
millis
();
// Create message to query MPOD and send it
SNMP
::
Message
*
message
=
mpod
.
read
();
snmp
.
send
(
message
,
IPAddress
(
10
,
42
,
0
,
3
),
SNMP
::
PORT
::
SNMP
);
snmp
.
send
(
message
,
IPAddress
(
10
,
42
,
0
,
1
),
SNMP
::
PORT
::
SNMP
);
delete
message
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment