Skip to content

SoftwareBitBang troubleshooting

Giovanni Blu Mitolo edited this page Jun 23, 2019 · 22 revisions

The first thing to do when trying to troubleshoot a problem with SoftwareBitBang is to donwload PJON's latest stable version from www.PJON.org or www.github.com/gioblu/PJON from and test the following examples:

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

Very often the problem can be related to an outdated or modified version of the library, so this may solve your problem. NetworkAnalysis and SpeedTest are designed to benchmark connectivity performance and reliability using the following analysis:

  • 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 how many times no acknowledgement was received
  • Busy or how many times the channel is found busy
  • Accuracy or ratio between correct packets and packets that contain mistakes

Interpret results

  • Many Fail and or Mistakes may mean devices are near their maximum communication range
  • Many Mistakes and or low Bandwidth may mean that interference is present, see mitigate interference
  • Many Fail and or Mistakes and or low speed may indicate Bad 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
  • 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.

examples/ARDUINO/Local/SoftwareBitBang/PacketSeparationTest can be used to verify that frame separation consistency is 100% reliable within your practical hardware or timing setup. 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.