-1

I have two somewhat similar sketches that use both HC-12 [for data collection] and a W5100-type Ethernet Shield [for Email construction and transmit]. Both sketches run fine until the code for the Ethernet Shield is invoked, which creates a connection and successfully transmits an Email. Once this happens, the HC-12 no longer receives transmits. No exceptions are raised, and I am at a loss to determine the cause of the problem. [The HC-12 is using pins 50-52.]

I have other sketches that use either the HC-12 or the Ethernet Shield, and they work fine. Before I build a custom sketch to attempt problem isolation, I thought I would simply ask the question of whether known conflicts exist. I know that many questions are resolved by posting the sketch and someone other than the author scanning it. I think that impractical in this particular case. The sketch comprises 6,000+ lines of code.

If no helpful responses are forthcoming, I will continue with problem isolation, and post again if no success is achieved.

KC Tucker
  • 394
  • 1
  • 7
  • 18

1 Answers1

0

As suggested by Majenko, the problem results from using Software Serial for the HC-12, and unfortunately choosing the pin set 50-52, which conflicts with the pin usage specification for the Ethercard Library. Hence, the HC-12 code works fine until usage of the Ethernet shield is finally activated. From that point on, the Ethernet code functions properly, whilst the HC-12 code does not. The recommended solution, which does indeed solve the problem, is to abandon usage of SoftwareSerial for the HC-12, and use Serial1, or Serial2, or Serial3 instead.

I do not feel that the solution to the problem is truly mine, but post it only that the information may be of subsequent use to a user encountering a problem of similar nature.

KC Tucker
  • 394
  • 1
  • 7
  • 18