Skip to content

SoftwareBitBang troubleshooting

Niklas Cathor edited this page Dec 16, 2021 · 22 revisions

Initial assessment

Study in detail your project's program because 99.9% of the times the problem is in there, specially if you are using supported hardware and doing legit stuff. If the issue is not solved donwload PJON's latest stable version from www.PJON.org or www.github.com/gioblu/PJON (very often issues are caused by an outdated or edited version of the library) and test your project's program.

If the problem is not solved go further testing the following examples:

  1. examples/ARDUINO/Local/SoftwareBitBang/NetworkAnalysis tests transmitter's side
  2. examples/ARDUINO/Local/SoftwareBitBang/SpeedTest tests receiver's side

NetworkAnalysis and SpeedTest are designed to benchmark connectivity performance and reliability using the following terms:

  • Packet overhead or how many bytes are added by PJON to data
  • Bandwidth or maximum amount of bytes transmitted in a second
  • Data throughput or how many data bytes are transmitted every second
  • Packets sent or number of packets transmitted in the test window
  • Mistakes or how many errors detected with CRC
  • Fail or number of transmission failures occurred in the test window
  • Busy or how many times the channel is found busy
  • Accuracy or ratio between correct packets and packets that contain mistakes

The result can be interpreted as follows:

  • Many Fail and or Mistakes may mean that the maximum communication range between devices has been reached
  • Many Busy and or Mistakes and or low Bandwidth may mean that interference is present, see mitigate interference
  • Many Fail and or Mistakes and or low Bandwidth may indicate a bad timing configuration, if you are porting a new MCU/architecture to SoftwareBitBang consider different timing configuration may be required because of system discrepancies. Try tweaking SWBB_BIT_WIDTH, SWBB_BIT_SPACER, SWBB_READ_DELAY and SWBB_ACCEPTANCE in Timing.h
  • Low performance also after painstaking timing tweaks may indicate that the new MCU/architecture may not be fast enough to run SoftwareBitBang at the mode you are working with, try using a faster clock or optimize digital I/O perfomance or choosing a slower mode.

Extended analysis

examples/ARDUINO/Local/SoftwareBitBang/PacketSeparationTest can be used to verify that frame separation is 100% reliable. This test has a transmitter device that sends a continuous random byte stream. The receiver device attempts to receive packets from pin 12, if an incoming packet is detected a false positive occurred. The receiver device prints the result of the test via serial. If any false positive is detected while testing a supported device, the system may dispatch corrupted data so please report this occurrence opening an issue in our github repository.