Comments (12)
Good morning
WISOL LOM204 LoRaWAN + W5500 working together :)
from ethernet_generic.
thank you!
https://lom204-cli-wisol.blogspot.com/2022/05/importante-opcao-nao-oficial-da-wisol.html
from ethernet_generic.
Hi @tcpipchip
I'm sorry I don't have that kind of hardware to help you, but these are steps you can try, test and adapt
- Define the new and extra SPI, such as SPI3 as you did in
variant_generic.h
#ifndef PIN_SPI3_MOSI
//LOM204
#define PIN_SPI3_MOSI PB15
#endif
#ifndef PIN_SPI3_MISO
//LOM204
#define PIN_SPI3_MISO PB14
#endif
#ifndef PIN_SPI3_SCK
//LOM204
#define PIN_SPI3_SCK PB13
#endif
#ifndef PIN_SPI_SS3
//LOM204
#define PIN_SPI_SS3 PB16 // Or another good pin
#endif
- Modify STM32 SPI library, or add somewhere in your code, to create an instance of SPI3 for STM32L072
// SPIClass(uint32_t mosi, uint32_t miso, uint32_t sclk, uint32_t ssel = PNUM_NOT_DEFINED);
SPIClass SPI3(PIN_SPI3_MOSI, PIN_SPI3_MISO, PIN_SPI3_SCK, PIN_SPI_SS3);
- Modify the file w5100_Impl.h to add STM32L072-related code
Ethernet_Generic/src/utility/w5100_Impl.h
Lines 197 to 223 in bab28a9
such as
#elif (ETHERNET_USE_RPIPICO && !defined(ARDUINO_ARCH_MBED))
// For arduino-pico core
// SPIClassRP2040(spi_inst_t *spi, pin_size_t rx, pin_size_t cs, pin_size_t sck, pin_size_t tx);
SPIClass* pCUR_SPI = (SPIClass*) &SPI1;
#define CUR_PIN_MISO PIN_SPI1_MISO
#define CUR_PIN_MOSI PIN_SPI1_MOSI
#define CUR_PIN_SCK PIN_SPI1_SCK
#define CUR_PIN_SS PIN_SPI1_SS
#elif defined(STM32L0)
// For STM32L072 of LOM204
// SPIClass SPI3(PIN_SPI3_MOSI, PIN_SPI3_MISO, PIN_SPI3_SCK, PIN_SPI_SS3);
SPIClass* pCUR_SPI = (SPIClass*) &SPI3;
#endif
- In you code, select
#define USING_SPI2 true
before
#include "Ethernet_Generic.h"
These steps are just drafted and not tested, you have to test and adapt according to your hardware and condition.
Good Luck
PS:
Why don't share the same SPI bus for both Ethernet and SX1276 LoRaWAN? Possibly some mods in the code and/or hardware to select the CS/SS pin to avoid SPI-bus monopolization
from ethernet_generic.
from ethernet_generic.
#define USING_SPI2 true OR the correct is
#define USING_SPI3 true
?
because in main() I see
#if (USING_SPI2)
#if defined(CUR_PIN_MISO)
ETG_LOGWARN(F("Default SPI pinout:"));
ETG_LOGWARN1(F("MOSI:"), CUR_PIN_MOSI);
ETG_LOGWARN1(F("MISO:"), CUR_PIN_MISO);
ETG_LOGWARN1(F("SCK:"), CUR_PIN_SCK);
ETG_LOGWARN1(F("SS:"), CUR_PIN_SS);
from ethernet_generic.
It's not important as each board is using the different notation.
So I just name
#define USING_SPI2 true
for any SPI besides SPI0/SPI1
I've modified the libraries and tested OK on Nucleo144 F767ZI and L552ZE-Q using SPI2. I'll publish new releases of this Ethernet_Generic and EthernetWebServer_STM32 to support SPI2, or any custom hardware SPI
I'm sure you can adapt the code and be OK.
WebClientRepeating on NUCLEO_F767ZI, using W5x00 using Ethernet_Generic Library on SPI2
Start WebClientRepeating on NUCLEO_F767ZI, using W5x00 using Ethernet_Generic Library on SPI2
EthernetWebServer_STM32 v1.4.2
[EWS] Default SPI pinout:
[EWS] MOSI: 22
[EWS] MISO: 25
[EWS] SCK: 23
[EWS] SS: 24
[EWS] =========================
Connected! IP address: 192.168.2.123
Connecting...
HTTP/1.1 200 OK
Date: Tue, 03 May 2022 02:21:30 GMT
Content-Type: text/plain
Content-Length: 2263
Connection: close
x-amz-id-2: 3UTJOk8AtRD5jCq+6bBOdAUucpho+KMM4ra+5/evX48oAT9NyZiaJbPNw5DOAr+amoxXbxbowX0=
x-amz-request-id: RB5W2BTZZ19E49PA
Last-Modified: Wed, 23 Feb 2022 14:56:42 GMT
ETag: "667cf48afcc12c38c8c1637947a04224"
CF-Cache-Status: DYNAMIC
Report-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=GhwgztuLVJJhJBZt6cqr%2BYWDLWUzEcRPjVVpSU3Sz9KSRzj4q4DK9bvi1B2BSl7uxytKSSxOFBnKeekqPJw9LvpyYpYvHuOVcxatw924HWhtyK1OCApzLxZRLmobotQ%3D"}],"group":"cf-nel","max_age":604800}
NEL: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
Server: cloudflare
CF-RAY: 705586061d4354d9-YYZ
alt-svc: h3=":443"; ma=86400, h3-29=":443"; ma=86400
`:;;;,` .:;;:.
.;;;;;;;;;;;` :;;;;;;;;;;: TM
`;;;;;;;;;;;;;;;` :;;;;;;;;;;;;;;;
:;;;;;;;;;;;;;;;;;; `;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;; .;;;;;;;;;;;;;;;;;;;;
;;;;;;;;:` `;;;;;;;;; ,;;;;;;;;.` .;;;;;;;;
.;;;;;;, :;;;;;;; .;;;;;;; ;;;;;;;
;;;;;; ;;;;;;; ;;;;;;, ;;;;;;.
,;;;;; ;;;;;;.;;;;;;` ;;;;;;
;;;;;. ;;;;;;;;;;;` ``` ;;;;;`
;;;;; ;;;;;;;;;, ;;; .;;;;;
`;;;;: `;;;;;;;; ;;; ;;;;;
,;;;;` `,,,,,,,, ;;;;;;; .,,;;;,,, ;;;;;
:;;;;` .;;;;;;;; ;;;;;, :;;;;;;;; ;;;;;
:;;;;` .;;;;;;;; `;;;;;; :;;;;;;;; ;;;;;
.;;;;. ;;;;;;;. ;;; ;;;;;
;;;;; ;;;;;;;;; ;;; ;;;;;
;;;;; .;;;;;;;;;; ;;; ;;;;;,
;;;;;; `;;;;;;;;;;;; ;;;;;
`;;;;;, .;;;;;; ;;;;;;; ;;;;;;
;;;;;;: :;;;;;;. ;;;;;;; ;;;;;;
;;;;;;;` .;;;;;;;, ;;;;;;;; ;;;;;;;:
;;;;;;;;;:,:;;;;;;;;;: ;;;;;;;;;;:,;;;;;;;;;;
`;;;;;;;;;;;;;;;;;;;. ;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;; :;;;;;;;;;;;;;;;;:
,;;;;;;;;;;;;;, ;;;;;;;;;;;;;;
.;;;;;;;;;` ,;;;;;;;;:
;;; ;;;;;` ;;;;: .;; ;; ,;;;;;, ;;. `;, ;;;;
;;; ;;:;;; ;;;;;; .;; ;; ,;;;;;: ;;; `;, ;;;:;;
,;:; ;; ;; ;; ;; .;; ;; ,;, ;;;,`;, ;; ;;
;; ;: ;; ;; ;; ;; .;; ;; ,;, ;;;;`;, ;; ;;.
;: ;; ;;;;;: ;; ;; .;; ;; ,;, ;;`;;;, ;; ;;`
,;;;;; ;;`;; ;; ;; .;; ;; ,;, ;; ;;;, ;; ;;
;; ,;, ;; .;; ;;;;;: ;;;;;: ,;;;;;: ;; ;;, ;;;;;;
;; ;; ;; ;;` ;;;;. `;;;: ,;;;;;, ;; ;;, ;;;;
WebClientRepeating on NUCLEO_L552ZE_Q, using W5x00 using Ethernet_Generic Library on SPI2
Start WebClientRepeating on NUCLEO_L552ZE_Q, using W5x00 using Ethernet_Generic Library on SPI2
EthernetWebServer_STM32 v1.4.2
[EWS] Default SPI pinout:
[EWS] MOSI: 22
[EWS] MISO: 25
[EWS] SCK: 23
[EWS] SS: 24
[EWS] =========================
Connected! IP address: 192.168.2.123
Connecting...
HTTP/1.1 200 OK
Date: Tue, 03 May 2022 02:40:24 GMT
Content-Type: text/plain
Content-Length: 2263
Connection: close
x-amz-id-2: 46EhWX58C9hyDf7ag/cTxLHtNc/l+uC2facDUqKXDnm4pAdM3721pkdwUwjVF0O7mr1MGAcjQiY=
x-amz-request-id: 04CEE3RJB7W2M05T
Last-Modified: Wed, 23 Feb 2022 14:56:42 GMT
ETag: "667cf48afcc12c38c8c1637947a04224"
CF-Cache-Status: DYNAMIC
Report-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=TYzyXPfNW7yd579FqPTzYEXQnSRcAFeyj74iulNNRmVZEUk6Qz%2F2dgIwFVJxacbwtzdVR9Q2FK2cgryr0GC9k3NfyFAgZpLZIjEwfEhycKWnNE9KxX%2F%2B6dRwTLcV9hY%3D"}],"group":"cf-nel","max_age":604800}
NEL: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
Server: cloudflare
CF-RAY: 7055a1b9cda84009-YYZ
alt-svc: h3=":443"; ma=86400, h3-29=":443"; ma=86400
`:;;;,` .:;;:.
.;;;;;;;;;;;` :;;;;;;;;;;: TM
`;;;;;;;;;;;;;;;` :;;;;;;;;;;;;;;;
:;;;;;;;;;;;;;;;;;; `;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;; .;;;;;;;;;;;;;;;;;;;;
;;;;;;;;:` `;;;;;;;;; ,;;;;;;;;.` .;;;;;;;;
.;;;;;;, :;;;;;;; .;;;;;;; ;;;;;;;
;;;;;; ;;;;;;; ;;;;;;, ;;;;;;.
,;;;;; ;;;;;;.;;;;;;` ;;;;;;
;;;;;. ;;;;;;;;;;;` ``` ;;;;;`
;;;;; ;;;;;;;;;, ;;; .;;;;;
`;;;;: `;;;;;;;; ;;; ;;;;;
,;;;;` `,,,,,,,, ;;;;;;; .,,;;;,,, ;;;;;
:;;;;` .;;;;;;;; ;;;;;, :;;;;;;;; ;;;;;
:;;;;` .;;;;;;;; `;;;;;; :;;;;;;;; ;;;;;
.;;;;. ;;;;;;;. ;;; ;;;;;
;;;;; ;;;;;;;;; ;;; ;;;;;
;;;;; .;;;;;;;;;; ;;; ;;;;;,
;;;;;; `;;;;;;;;;;;; ;;;;;
`;;;;;, .;;;;;; ;;;;;;; ;;;;;;
;;;;;;: :;;;;;;. ;;;;;;; ;;;;;;
;;;;;;;` .;;;;;;;, ;;;;;;;; ;;;;;;;:
;;;;;;;;;:,:;;;;;;;;;: ;;;;;;;;;;:,;;;;;;;;;;
`;;;;;;;;;;;;;;;;;;;. ;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;; :;;;;;;;;;;;;;;;;:
,;;;;;;;;;;;;;, ;;;;;;;;;;;;;;
.;;;;;;;;;` ,;;;;;;;;:
;;; ;;;;;` ;;;;: .;; ;; ,;;;;;, ;;. `;, ;;;;
;;; ;;:;;; ;;;;;; .;; ;; ,;;;;;: ;;; `;, ;;;:;;
,;:; ;; ;; ;; ;; .;; ;; ,;, ;;;,`;, ;; ;;
;; ;: ;; ;; ;; ;; .;; ;; ,;, ;;;;`;, ;; ;;.
;: ;; ;;;;;: ;; ;; .;; ;; ,;, ;;`;;;, ;; ;;`
,;;;;; ;;`;; ;; ;; .;; ;; ,;, ;; ;;;, ;; ;;
;; ,;, ;; .;; ;;;;;: ;;;;;: ,;;;;;: ;; ;;, ;;;;;;
;; ;; ;; ;;` ;;;;. `;;;: ,;;;;;, ;; ;;, ;;;;
from ethernet_generic.
The Ethernet_Generic releases v2.2.0 has just been published
You now can use any SPI with STM32, or any future boards.
To adapt to any STM32 board, just simply change in defines.h
, for examples
Ethernet_Generic/examples/WebClientRepeating/defines.h
Lines 313 to 352 in 8b5eada
Releases v2.2.0
- Add support to STM32 boards using Arduino_Core_STM32
- Add support to any board with core supporting custom hardware / software
SPI
, for example STM32.
from ethernet_generic.
The EthernetWebServer_STM32 releases v1.5.0 has just been published
You now can use any SPI with STM32
To adapt to any STM32 board, just simply change in defines.h
, for examples
#if USE_ETHERNET_GENERIC
#include <SPI.h>
// Be sure to use true only if necessary for your board, or compile error
#define USING_CUSTOM_SPI true
#if ( USING_CUSTOM_SPI )
// Currently test OK for F767ZI and L552ZE_Q
#define USING_SPI2 true
#define SHIELD_TYPE "W5x00 using Ethernet_Generic Library and custom SPI"
#if (USING_SPI2)
// For L552ZE-Q, F767ZI, but you can change the pins for any other boards
// SCK: 23, MOSI: 22, MISO: 25, SS/CS: 24 for SPI1
#define CUR_PIN_MISO 25
#define CUR_PIN_MOSI 22
#define CUR_PIN_SCK 23
#define CUR_PIN_SS 24
#define SPI_NEW_INITIALIZED true
// Don't create the instance with CUR_PIN_SS, or Ethernet not working
// To change for other boards' SPI libraries
SPIClass SPI_New(CUR_PIN_MOSI, CUR_PIN_MISO, CUR_PIN_SCK);
//#warning Using USE_THIS_SS_PIN = CUR_PIN_SS = 24
#if defined(USE_THIS_SS_PIN)
#undef USE_THIS_SS_PIN
#endif
#define USE_THIS_SS_PIN CUR_PIN_SS //24
#endif
#else
#define SHIELD_TYPE "W5x00 using Ethernet_Generic Library"
#endif
#include "Ethernet_Generic.h"
#define ETHERNET_LARGE_BUFFERS
#define _ETG_LOGLEVEL_ 1
#endif
Releases v1.5.0
- Add support to any custom hardware / software
SPI
for W5x00 using Ethernet_Generic Library - Add support to STM32L5 boards, such as
Nucleo-L552ZE-Q
from ethernet_generic.
Nice! I will test it this afternoon :)
LoRaWAN and Ethernet together π
from ethernet_generic.
i will test more then we update the Github :)
from ethernet_generic.
Tests ok
Wich software terminal do you use to show aligment arduino text (splash)?
from ethernet_generic.
Just using Arduino IDE Terminal.
IMO, good and reliable terminal must be dumb and just printing out whatever the output is.
You have to format the output as you'd like before sending any text to the terminal.
from ethernet_generic.
Related Issues (8)
- ESP32-W5500 Webclient and Webserver not working HOT 1
- 'ETHERNET_SERVER_SEND_MAX_SIZE' was not declared in this scope HOT 2
- Ethernet.begin(&MAC) hangs when DHCP is not available HOT 1
- Why always loading EthernetWebServer and LittleFS? HOT 1
- Feature request: server.end() and server.begin(port) HOT 2
- Multiple Definition when linking HOT 3
- RP2040 Mbed Core SPI pins
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ethernet_generic.