[Bug Report] Runtime errors in vanet.py (AttributeError & UnboundLocalError) - Mininet-WiFi

19 views
Skip to first unread message

22029106 Nguyễn Trương Dũng

unread,
Jan 23, 2026, 8:28:03 AMJan 23
to mininet-wifi-discuss

Dear Ramon Fontes,

First of all, thank you for your excellent work on Mininet-WiFi. It is a fantastic tool for our research.

I am writing to report two issues I encountered while using the vanet.py module in the latest master branch (Commit: 070ea2d, dated Jan 9, 2026).

Here are the details of the bugs and the temporary fixes I applied locally:

1. AttributeError: 'OVSAP' object has no attribute 'lastpos'

Location: mn_wifi/vanet.py, inside display_grid method. The Issue: When initializing the grid with Access Points (OVSAP), the code attempts to call bs.set_pos_wmediumd(bs.position). However, in the current version, the AP object does not seem to have the lastpos attribute initialized at this stage, causing a crash.

Traceback:
File ".../mn_wifi/vanet.py", line 151, in display_grid
    bs.set_pos_wmediumd(bs.position)
File ".../mn_wifi/node.py", line 211, in set_pos_wmediumd
    if self.lastpos != pos:
AttributeError: 'OVSAP' object has no attribute 'lastpos'

2. UnboundLocalError: local variable 'x_min' referenced before assignment

Location: mn_wifi/vanet.py, inside display_cars method. The Issue: The variables x_min, x_max, y_min, y_max are initialized inside a for loop iterating over self.roads. However, they are later used in self.carProp calls. If the loop logic flow varies, these variables remain uninitialized when carProp is called.

Traceback:

File ".../mn_wifi/vanet.py", line 223, in display_cars
    car.prop = self.carProp(point, ang, x_min, x_max, y_min, y_max)
UnboundLocalError: local variable 'x_min' referenced before assignment

I hope this feedback helps improve the stability of the VANET module. Looking forward to the next update.

Best regards,

Nguyen Truong Dung

Ramon Fontes

unread,
Jan 30, 2026, 9:30:37 AMJan 30
to 22029106 Nguyễn Trương Dũng, mininet-wifi-discuss
Dear Nguyen Truong Dung,

Thank you very much for the detailed report and for your kind words
about Mininet-WiFi. I really appreciate the feedback. :)

Just to better understand the context of these errors, could you
please let me know if you are running any specific script or custom
configuration when using the vanet.py module? For example, are you
using a particular VANET scenario, mobility model, or initialization
sequence that consistently triggers these issues?

Thanks again for taking the time to report this.

Best regards,
Ramon Fontes

Em sex., 23 de jan. de 2026 às 10:28, 22029106 Nguyễn Trương Dũng
<2202...@vnu.edu.vn> escreveu:
> --
> You received this message because you are subscribed to the Google Groups "mininet-wifi-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to mininet-wifi-dis...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/mininet-wifi-discuss/852837c8-d605-4b51-adf8-5e53ec391e3bn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages