Skip to content

SoftwareBitBang troubleshooting

Giovanni Blu Mitolo edited this page Apr 9, 2019 · 22 revisions

Pull PJON's latest stable version from this repository and run the NetworkAnalysis and SpeedTest examples. These 2 tests are designed to benchmark performance and reliability:

  • Absolute communication speed
  • Practical bandwidth or channel throughput
  • Number of packets sent in the test window
  • How many errors detected with CRC
  • How many times the receive function ended with no reception
  • How many times the channel is found busy
  • Accuracy ( packets sent / packets received with mistakes ratio)

Range

  • Long distance between devices.
  • Many failed receptions.
  • Many mistakes detected by CRC.

You are probably near the maximum distance range of your system. The solution can be to higher transmission power if possible.

Interference

  • Channel detected busy many times.
  • Many mistakes detected by CRC.
  • Low or absent communication speed.

Device avoids to transmit over noise to ensure correct communication, when the medium is affected by noise, data throughput and communication reliability drops. Because of interference are also detected mistakes by CRC. See the dedicated wiki page Mitigate interference.

Timing

  • Many failed receptions.
  • Many mistakes detected by CRC.
  • Low or absent communication speed.

Bad syncronization or timing configuration. If you are porting a new device or architecture to SoftwareBitBang, AnalogSampling or OverSampling consider that each MCU can need a different timing configuration because of clock or system discrepancies. Try tweaking BIT_WIDTH, BIT_SPACER, READ_DELAY and ACCEPTANCE in Timing.h.

Execution time

  • Low quality of communication also after tuning / timing tweek.
  • Many failed receptions.
  • Many CRC detected mistakes.
  • Low or absent communication speed.

Every architecture needs a different time to execute PJON, so at the point where it should start to read the first bit of a byte, after initial padding bits, it can be shifted relatively to the transmitter, and so not able to read correctly the bit sequence. READ_DELAY constant in Timing.h regulates the correct positioning of the 8 readings in each bit. Take in consideration that a still not ported MCU/architecture may not be fast enough to run PJON, try using a faster clock or optimize digital I/O perfomance.