question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Understanding network.scanner.search

See original GitHub issue

I’m using Raspberry Pi with MCP2515 connected to a network consisting of two Delta servo drives. I am trying to get this example to work:

network.scanner.search()
time.sleep(0.05)
for node_id in network.scanner.nodes:
    print("Found node %d!" % node_id)

As far as I can tell, network.scanner.search sends SDO message to all possible nodes on the bus (1-128).

for node_id in range(1, limit + 1):
            self.network.send_message(0x600 + node_id, sdo_req)

But how does it actually find out there are nodes present (which method in the class)? i.e. which method is listening for a response message from the node?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
christiansandbergcommented, Jun 13, 2018

You can create a can.Listener and attach it to Network.listeners.

class MyListener(can.Listener):
    def on_message_received(self, msg):
        print(repr(msg))

network.listeners.append(MyListener())
1reaction
christiansandbergcommented, Jun 9, 2018

The NodeScanner.on_message_received method collects messages coming from slave nodes and is called from Network.notify which receives all messages coming in from the bus.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Network Scanner: What Is It and How Does It Work? - Tek-Tools
Regular scanning of your network allows you to keep track of the devices on your network, view how they're performing, spot the flaws,...
Read more >
Network Scanning - Definition, Use, and Examples - DNSstuff
Active scanning is when the tool sends a ping to each device on the network and awaits a response. The scanner then looks...
Read more >
How To Scan Network for IP Addresses Using CMD & Top ...
Here's a QUICK and Thorough Guide on How To Scan Network for IP Addresses In your Network using Command-Line Tools & FREE Software...
Read more >
What is a Network Scanner? - Definition & Use - Study.com
A penetration tester or hacker, however, will use a scanner in the early phases of a hack or penetration exercise to find what...
Read more >
How to Find all Devices on Network | Network Scanner
How to find all Network Devices on my Network, like windows computers, printers and switches. The Lansweeper network scanner tool can list ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found