This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

python device_page_generator.py -d nrf52832_xxAA -sd "s132_7.0.1" failed

use nrf5_SDK_for_Mesh_v4.0.0_src fail

nrf5_SDK_for_Mesh_v4.0.0_src\tools\dfu>python device_page_generator.py -d nrf52832_xxAA -sd "s132_7.0.1"
Traceback (most recent call last):
  File "device_page_generator.py", line 244, in <module>
    main()
  File "device_page_generator.py", line 238, in main
    write_specific_page(platforms, softdevices, args)
  File "device_page_generator.py", line 177, in write_specific_page
    bootloader_config = json.load(f)["bootloader_config"]
  File "C:\Python35\lib\json\__init__.py", line 268, in load
    parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
  File "C:\Python35\lib\json\__init__.py", line 319, in loads
    return _default_decoder.decode(s)
  File "C:\Python35\lib\json\decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Python35\lib\json\decoder.py", line 355, in raw_decode
    obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting ',' delimiter: line 8 column 3 (char 180)

But nrf5_SDK_for_Mesh_v3.2.0_src succeed

nrf5_SDK_for_Mesh_v3.2.0_src\tools\dfu>python device_page_generator.py -d nrf52832_xxAA -sd "s132_6.1.1"
Wrote device page for nrf52832_xxAA with the s132_6.1.1 SoftDevice to bin/device_page_nrf52832_xxAA_s132_6.1.1.hex.

pip install intelhex

You are using pip version 6.1.0, however version 19.3.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Requirement already satisfied (use --upgrade to upgrade): intelhex in c:\python27\lib\site-packages

Parents
  • Hi John, 
    Could you try to update python to at least v3.5.1  ? I'm using Python v3.7 and it works fine for me. 
    Also please make sure you installed pip3 install -r requirements.txt 

    Also, please use the correct .json file. I attached here for reference.

     

    {
        "bootloader_config": {
            "bootloader_id": 1,
            "bootloader_version": 1,
            "company_id": 89,
            "application_id": 1,
            "application_version": 1
        }
    }
    

  • Hi Hung,

     Thanks for your support.

    nrf5_SDK_for_Mesh_v4.0.0_src\tools\dfu>python35 -V
    Python 3.5.4

    nrf5_SDK_for_Mesh_v4.0.0_src\tools\dfu>pip3 install -r requirements.txt

    Requirement already satisfied: pyserial in c:\python35\lib\site-packages (from -r requirements.txt (line 2)) (3.4)
    Requirement already satisfied: intelhex in c:\python35\lib\site-packages (from -r requirements.txt (line 3)) (2.2.1)

    bootloader_config_default.json

        "bootloader_config": {
            "bootloader_id": 1,
            "bootloader_version": 1,
            "company_id": 89,
            "application_id": 1,
            "application_version": 1
      "public_key":
      "558cdba44e90f9354a6eae8436ff8a8161556b4bea6980baa9890a6536fe248e5f6a333c1dffa27fc529c67609a1345888176a77a969a700e442271ea792d847"
        }

    nrf5_SDK_for_Mesh_v4.0.0_src\tools\dfu>python35 device_page_generator.py -d nrf52832_xxAA -sd "s132_7.0.1"
    Traceback (most recent call last):
      File "device_page_generator.py", line 244, in <module>
        main()
      File "device_page_generator.py", line 238, in main
        write_specific_page(platforms, softdevices, args)
      File "device_page_generator.py", line 177, in write_specific_page
        bootloader_config = json.load(f)["bootloader_config"]
      File "C:\Python35\lib\json\__init__.py", line 268, in load
        parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
      File "C:\Python35\lib\json\__init__.py", line 319, in loads
        return _default_decoder.decode(s)
      File "C:\Python35\lib\json\decoder.py", line 339, in decode
        obj, end = self.raw_decode(s, idx=_w(s, 0).end())
      File "C:\Python35\lib\json\decoder.py", line 355, in raw_decode
        obj, end = self.scan_once(s, idx)
    json.decoder.JSONDecodeError: Expecting ',' delimiter: line 8 column 3 (char 180)

  • Hi John,

    A "," is missing after application_version":1 . Your .json file should look like: 

    {
        "bootloader_config": {
            "bootloader_id": 1,
            "bootloader_version": 1,
            "company_id": 89,
            "application_id": 1,
            "application_version": 1,
    		 "public_key": "558cdba44e90f9354a6eae8436ff8a8161556b4bea6980baa9890a6536fe248e5f6a333c1dffa27fc529c67609a1345888176a77a969a700e442271ea792d847"
        }
    }

Reply
  • Hi John,

    A "," is missing after application_version":1 . Your .json file should look like: 

    {
        "bootloader_config": {
            "bootloader_id": 1,
            "bootloader_version": 1,
            "company_id": 89,
            "application_id": 1,
            "application_version": 1,
    		 "public_key": "558cdba44e90f9354a6eae8436ff8a8161556b4bea6980baa9890a6536fe248e5f6a333c1dffa27fc529c67609a1345888176a77a969a700e442271ea792d847"
        }
    }

Children
Related